Additional changes, fixes

Added a lot of function