Made functions virtual so they are correctly used when inherited