cleaned the code a bit
Merge branch 'master' into testing