a buttload of changes
added error for incorrect parameter combination