[Issue #359][WIP] fixed code