Edited from development branch