version 004, with few more features
formatting changes