Added some more functionality, rewrite needed to reduce redundancy.
Merge remote-tracking branch 'origin/dev' into dev