solved and cleaned up