added fucntionality to check and parse arguments