final commit with added functions for checking type