changed from casting to ATOI function