work on internal logic