fixed bug + cleaned up