cleaned up code, new design