Tried writing a method for exam prep