cleaned up, commented where necessary, readme written