refined version 1