following logic done