started working on function check