First version with half-working local variables :)