Added some more functionality and improvements