made changes to obstacle constructor