working and cleaned up