Fixed some bugs, made things clearer