atuomated code a bit more