Added new (partial) functions and fixed some issues. Rewrote some lines to use %s (still more to go)