merged the lab provided by Alex; edited