Added more functionality, fixed a few problems here and there