Lots of minor changes. Removed hardcoded values.