cleaned version 2