Simplified the code (check for %15 instead of %3 and %5)