Commit 5

fixed freezing problem and added stage 2