Added subroutines and libraries.
These are not finished though yet