cleaned up
added more functionality