login working and cleaned up