Scaling corrected + some aesthetic code changes.