fixed block function

just noticed that some of the code was unreachable or wrong lol