Made some subroutines pure

Maked all subroutines I could a pure.
Added unique functions and subs

Added unique functions and suboutines that are all under the interface
unique.