cleaned up code and fixed readme type