Dev

Added encapsulation and other improvements / bugfixes