Attempt at implementing an ecological model