Version 0.2 taken from main branch