cleaned up some code. got pw intergreated