changed logic v0.2