fixing some bugs, adding some credit