adds functions
adds type guards