Fixed all bugs, need to finish comments