cleaned up code

added version and fixed other things