working_version
add type verification and exceptions