adding RegEx and parseInt function