Added subroutines and constants