[tested] fixed #4 with separate files