added ipv4toint function

also fixed a bug in the v4 checking functionality
messy messy