got rid of a lot of warning but changing int types and using len() instead of size()