Might want to note that in order to take off one of the researches (for some unknown reason) you need to AND with the complement of the bit. For example, if you had picked the g_shield_research and want to degrade it or something you use:
Hi, I just noticed something about your code. If the user is to enter a negative amount and deposit it, they would get more gold than they had in their hand and get a negative bank value.