use opt instead of as
added more tests