implemented various functions; still need to do further testing