fixing some bugs, adding more methods