added null and type checking in methods, set minimal block size constraint