Edited constructor with if-statements
Merge origin/master