added init function
added subf-s for init