changed the types used in some functions