Added some procedures

and some additional functionality