changed behavior and added options