fixing bugs with function naming