making my own checks as java asserts didnt work well for me