diff --git a/distributed-gorilla-master/.gitignore b/distributed-gorilla-master/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..254c42d3855ef23e899f2914ff4ead5990c20e1a
--- /dev/null
+++ b/distributed-gorilla-master/.gitignore
@@ -0,0 +1,24 @@
+contracts/
+.classpath
+.project
+.history/
+.idea
+.jqwik-database
+.lib/
+.worksheet
+.settings/
+# Without .classpath Eclipse creates its own project structure before reading Maven configuration including bin/
+bin/
+*.iml
+*.ipr
+*.iws
+*.log
+project/boot/
+project/plugins/project/
+project/project/
+project/*-shim.sbt
+project/target/
+target/
+openjfx/
+dependency-reduced-pom.xml
+.vscode/
diff --git a/distributed-gorilla-master/.gitlab-ci.yml b/distributed-gorilla-master/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..4b3553b42ff83c2ef7e7ea37ffa030aaaf554898
--- /dev/null
+++ b/distributed-gorilla-master/.gitlab-ci.yml
@@ -0,0 +1,13 @@
+image: maven:latest
+
+stages:
+  - build
+  - test
+
+build:
+  script:
+    - mvn compile
+
+test:
+  script:
+    - mvn test
\ No newline at end of file
diff --git a/distributed-gorilla-master/Doxyfile b/distributed-gorilla-master/Doxyfile
new file mode 100644
index 0000000000000000000000000000000000000000..5ec98da49c053733a6e59698eea255c1c21dcef5
--- /dev/null
+++ b/distributed-gorilla-master/Doxyfile
@@ -0,0 +1,2535 @@
+# Doxyfile 1.8.15
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME           = distributed-gorilla
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER         = 1.0
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          = "Gorillasota 2029"
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = doc
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS         = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES    = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE        = English
+
+# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all generated output in the proper direction.
+# Possible values are: None, LTR, RTL and Context.
+# The default value is: None.
+
+OUTPUT_TEXT_DIRECTION  = None
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF           = NO
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES        = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES            = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines (in the resulting output). You can put ^^ in the value part of an
+# alias to insert a newline as if a physical newline was in the original file.
+# When you need a literal { or } or , in the value part of an alias you have to
+# escape them by means of a backslash (\), this can lead to conflicts with the
+# commands \{ and \} for these it is advised to use the version @{ and @} or use
+# a double escape (\\{ and \\})
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA   = YES
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE  = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
+# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is
+# Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT       = YES
+
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 0.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS   = 0
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC  = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS               = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation. If
+# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC       = NO
+
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered.
+# The default value is: NO.
+
+WARN_AS_ERROR          = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
+
+INPUT                  = src
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
+# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
+
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.idl \
+                         *.ddl \
+                         *.odl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.cs \
+                         *.d \
+                         *.php \
+                         *.php4 \
+                         *.php5 \
+                         *.phtml \
+                         *.inc \
+                         *.m \
+                         *.markdown \
+                         *.md \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.pyw \
+                         *.f90 \
+                         *.f95 \
+                         *.f03 \
+                         *.f08 \
+                         *.f \
+                         *.for \
+                         *.tcl \
+                         *.vhd \
+                         *.vhdl \
+                         *.ucf \
+                         *.qsf
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES         = YES
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS    = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# entity all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS        = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see https://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX     = YES
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET  =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP         = NO
+
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
+# documentation will contain a main index with vertical navigation menus that
+# are dynamically created via Javascript. If disabled, the navigation index will
+# consists of multiple levels of tabs that are statically embedded in every HTML
+# page. Disable this option to support browsers that do not have Javascript,
+# like the Qt help browser.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_MENUS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: https://developer.apple.com/xcode/), introduced with OSX
+# 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
+# genXcode/_index.html for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET        = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP      = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE               =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION           =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI           = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING     =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW      = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH         = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# https://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT         = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from https://www.mathjax.org before deployment.
+# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH        = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS     =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE       =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE           = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH    = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: https://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH        = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: https://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL       =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE        = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID     =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS  =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: \makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_MAKEINDEX_CMD    = \makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER           =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES      =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE        = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES     = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE        = plain
+
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP        = NO
+
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EMOJI_DIRECTORY  =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE    =
+
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE        = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION          = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR             =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT             = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING     = YES
+
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_NS_MEMB_FILE_SCOPE = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK       = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT         = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS        = YES
+
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES         = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS         = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH               =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS        = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH          = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG        = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS           =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS           =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH      =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE      =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH  =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP            = YES
diff --git a/distributed-gorilla-master/README.md b/distributed-gorilla-master/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..f691ef631b3bafbfdf39d8978af2c5b976f71290
--- /dev/null
+++ b/distributed-gorilla-master/README.md
@@ -0,0 +1,79 @@
+# Assignment
+This README contains only general instructions on how to run the game. The development setup, assignment, program structure and hints for completing the assignment can be found in [doc/index.md](doc/index.md) (in Finnish).
+
+# Project description
+A game where a bunch of gorillas try to kill each other by throwing bananas on time-limited turns. Last survivor is the winner.
+
+Requires Java 11 or later. Compatible with
+Eclipse, IntelliJ IDEA and VS Code with Java Extension Pack. Minor issues with Netbeans.
+
+## Installation
+
+Maven:
+
+```bash
+$ git clone https://gitlab.utu.fi/tech/education/distributed-systems/distributed-gorilla
+
+$ cd distributed-gorilla
+
+$ mvn compile package exec:java
+```
+
+SBT:
+
+```bash
+$ git clone https://gitlab.utu.fi/tech/education/distributed-systems/distributed-gorilla
+
+$ cd distributed-gorilla
+
+$ sbt compile run
+```
+
+## JavaFX bugs
+
+JavaFX has serious memory leaks that might lead to a crash in just seconds.
+Use the following JVM parameter to switch to software rendering pipeline that
+does not have the leaks
+```
+-Dprism.order=sw
+```
+
+E.g.
+
+```bash
+$ java -Dprism.order=sw -jar target/distributed-gorilla-1.0.jar
+```
+
+The game will allocate significant amounts of memory. Use the following switch
+to restrict the heap size to avoid wasting RAM:
+
+```
+-Xmx2000m
+```
+
+References:
+
+* https://bugs.openjdk.java.net/browse/JDK-8092801
+* https://bugs.openjdk.java.net/browse/JDK-8088396
+* https://bugs.openjdk.java.net/browse/JDK-8161997
+* https://bugs.openjdk.java.net/browse/JDK-8156051
+* https://bugs.openjdk.java.net/browse/JDK-8161914
+* https://bugs.openjdk.java.net/browse/JDK-8188094
+* https://stackoverflow.com/a/41398214
+
+## Further instructions
+
+  * Java platform: https://gitlab.utu.fi/soft/ftdev/wikis/tutorials/jvm-platform
+  * Maven: https://gitlab.utu.fi/soft/ftdev/wikis/tutorials/maven-misc
+  * SBT: https://gitlab.utu.fi/soft/ftdev/wikis/tutorials/sbt-misc
+  * OOMkit: https://gitlab.utu.fi/tech/education/oom/oomkit
+
+Course related
+
+  * https://gitlab.utu.fi/tech/education/distributed-systems/distributed-chat
+  * https://gitlab.utu.fi/tech/education/distributed-systems/distributed-crypto
+  * https://gitlab.utu.fi/tech/education/distributed-systems/distributed-classloader
+
+## Screenshots
+
+![Game](web/screenshot1.png)
diff --git a/distributed-gorilla-master/SELVITYS.md b/distributed-gorilla-master/SELVITYS.md
new file mode 100644
index 0000000000000000000000000000000000000000..3f92e4ed1e50dd498bb141662decf8097d8bdd19
--- /dev/null
+++ b/distributed-gorilla-master/SELVITYS.md
@@ -0,0 +1,5 @@
+# Tehtävä 2
+Tehtävän 2 vastaus tänne
+
+# Tehtävä 3
+Tehtävän 3 vastaus tänne
\ No newline at end of file
diff --git a/distributed-gorilla-master/build.sbt b/distributed-gorilla-master/build.sbt
new file mode 100644
index 0000000000000000000000000000000000000000..46b47213666b48589621d5ca0b69c88c8cc3cfef
--- /dev/null
+++ b/distributed-gorilla-master/build.sbt
@@ -0,0 +1,239 @@
+// Project template
+
+// Supported operating systems: Windows, Mac, Linux
+// Supported JDKs: 8, 10+
+
+// Project name
+name := "distributed-gorilla"
+
+// organization name
+organization := "fi.utu.tech"
+
+version := "1.0"
+
+// project description
+description := "Gorillasota 2029"
+
+// main class
+Compile/mainClass := Some("fi.utu.tech.distributed.gorilla.Main")
+
+// force the java version by typing it here (remove the comment)
+val force_javaVersion = None // Some(13)
+
+// force the javafx version by typing it here (remove the comment)
+val force_javaFxVersion = None // Some(13)
+
+val useJavaFX = true
+
+val useScalaOrScalaFX = true
+
+// END_OF_SIMPLE_CONFIGURATION
+// you can copy the rest for each new project
+// --- --- ---
+
+def fail(msg: String) = {
+  println("Error :-/")
+  println
+  println(msg)
+  System.exit(1)
+  null
+}
+
+val detectedJDK = System.getProperty("java.version").replace("-ea","").split('.').dropWhile(_.toInt<8).head.toInt
+
+val javaVersionNum = force_javaVersion.getOrElse(detectedJDK)
+
+val javaVersionString = javaVersionNum match {
+  case 7 => "1.7"
+  case 8 => "1.8"
+  case x if x > 8 => x.toString
+}
+
+val lts = 11
+val dev = 13
+
+val supported = javaVersionNum match {
+  case x if x < 8              => fail("Your Java installation is obsolete. Please upgrade to Java " + lts + "LTS")
+  case 9                       => fail("Your Java installation is unsupported and has known issues. Please upgrade to Java " + lts + "LTS")
+  case x if x < lts            => println("Consider upgrading to Java " + lts + " LTS"); true
+  case x if x > lts && x < dev => println("Consider upgrading to Java " + dev); true
+  case x if x > dev            => println("Unsupported early access version. Consider switching back to Java " + dev); true
+  case _                       => true
+}
+
+javacOptions ++= Seq("-source", javaVersionString, "-target", javaVersionString, "-encoding", "utf8", "-Xlint:unchecked", "-Xlint:deprecation")
+javacOptions in doc := Seq("-source", javaVersionString) 
+
+enablePlugins(JShellPlugin)
+
+compileOrder := CompileOrder.JavaThenScala
+
+// Enables publishing to maven repo
+publishMavenStyle := true
+
+// Do not append Scala versions to the generated artifacts
+crossPaths := false
+
+// This forbids including Scala related libraries into the dependency
+autoScalaLibrary := false
+
+assemblyMergeStrategy in assembly := {
+  case PathList("META-INF", xs @ _*) => MergeStrategy.discard
+  case _ => MergeStrategy.first
+}
+
+// contains libraries provided by utu/ft dep
+resolvers += "ftdev" at "https://ftdev.utu.fi/maven2"
+
+fork in Global := true
+
+val javaVersion = taskKey[Unit]("Prints the Java version.")
+
+javaVersion := { println("SBT uses Java SDK located at "+System.getProperty("java.home")) }
+
+publishTo := Some(Resolver.file("file", new File("/tmp/repository")))
+
+val oomkit = "fi.utu.tech" % "oomkit" % "1.18"
+val crypto = "fi.utu.tech" % "distributed-classloader" % "1.0"
+val classloader = "fi.utu.tech" % "distributed-crypto" % "1.0"
+
+libraryDependencies ++= Seq(oomkit, crypto, classloader)
+
+
+////
+//// JQWIK / JUNIT configuration
+////
+
+resolvers in ThisBuild += Resolver.jcenterRepo
+
+val junit_version = "5.5.2"
+
+// library dependencies. (orginization name) % (project name) % (version)
+libraryDependencies ++= Seq(
+  "net.aichler"        % "jupiter-interface"              % JupiterKeys.jupiterVersion.value % Test,
+  "org.junit.platform" % "junit-platform-commons"         % ("1"+junit_version.tail) % Test,
+  "org.junit.platform" % "junit-platform-runner"          % ("1"+junit_version.tail) % Test,
+  "org.junit.jupiter"  % "junit-jupiter-engine"           % junit_version % Test,
+  "org.junit.jupiter"  % "junit-jupiter-api"              % junit_version % Test,
+  "org.junit.jupiter"  % "junit-jupiter-migrationsupport" % junit_version % Test,
+  "org.junit.jupiter"  % "junit-jupiter-params"           % junit_version % Test,
+  "net.jqwik"          % "jqwik"                          % "1.2.0" % Test,
+  "org.scalatest"      %% "scalatest"                     % "3.0.8" % Test,
+)
+
+testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-c")
+
+////
+//// JAVAFX configuration
+////
+
+val javafx_versions = if (!useJavaFX) (0,"-","-") else (force_javaFxVersion getOrElse javaVersionNum) match {
+  case 7 => (7, "7", "8.0.181-R13")
+  case 8 => (8, "8", "8.0.181-R13")
+  case 10 => (11, "11.0.2", "11-R16")
+  case x if x>10 => (13, "13", "12.0.2-R18")
+  case _ => fail("Unsupported Java version for JavaFX")
+}
+
+// JAVA_HOME location
+val javaHomeDir = {
+  val path = try {
+    if (scala.sys.env("JAVA_HOME").trim.isEmpty) throw new Exception("Empty JAVA_HOME") else scala.sys.env("JAVA_HOME")
+  } catch {
+    case _: Throwable => System.getProperty("java.home") // not set -> ask from current JVM
+  }
+
+  val f = file(path)
+  if (!f.exists()) fail("The environment variable JAVA_HOME points to a non-existent directory!\nSolution: Edit your system settings (Windows control panel / *nix .bashrc) and fix the JAVA_HOME location.")
+  f
+}
+
+val osName: SettingKey[String] = SettingKey[String]("osName")
+
+osName := (System.getProperty("os.name") match {
+  case n if n.startsWith("Linux")   => "linux"
+  case n if n.startsWith("Mac")     => "mac"
+  case n if n.startsWith("Windows") => "win"
+  case _ => throw new Exception("Unknown platform!")
+})
+
+def legacyJavaFX() = {
+  val searchDirs = Seq(
+    "/jre/lib/jfxrt.jar",     // OpenJDK 7
+    "/jre/lib/ext/jfxrt.jar", // OpenJDK 8
+    "/lib/ext/jfxrt.jar"      // Windows & Oracle Java 8
+  )
+
+  if (detectedJDK > 8) fail(s"Trying to use legacy non-modular JavaFX with a modern JDK [$detectedJDK].\nSolution: Check the line 'val force_javaFxVersion =' in build.sbt.")
+
+  val javaFxJAR = searchDirs.map{ searchDir => file(javaHomeDir + searchDir) }.find{ _.exists() }
+
+  javaFxJAR.getOrElse {
+    fail(s"Java FX runtime not installed in [${javaHomeDir.toString}]!\nSolution: Install JavaFX or consider upgrading your JDK so that JavaFX can be installed automatically.")
+  }
+}
+
+val jfx_sdk_version = javafx_versions._2
+val jfx_scalafx_version = javafx_versions._3
+
+val javaFxPath = Def.taskKey[File]("OpenJFX fetcher")
+javaFxPath := {
+  val javaFxHome =
+    try {
+      val envHome = file(scala.sys.env("JAVAFX_HOME"))
+      if (envHome.toString.trim.isEmpty) throw new Exception("Empty JAVAFX_HOME")
+      println("Using OpenJFX from " + envHome)
+      envHome
+    }
+    catch { case _: Throwable =>
+        println("Using local OpenJFX")
+        baseDirectory.value / "openjfx"
+    }
+
+  if (!javaFxHome.exists()) java.nio.file.Files.createDirectory(javaFxHome.toPath)
+
+  val jfx_os = osName.value match {
+    case "linux" => "linux"
+    case "mac"   => "osx"
+    case "win"   => "windows"
+  }
+
+  val sdkURL = "http://download2.gluonhq.com/openjfx/" + jfx_sdk_version + "/openjfx-" + jfx_sdk_version + "_" + jfx_os + "-x64_bin-sdk.zip"
+
+  try {
+    val testDir = javaFxHome / "all.ok"
+    if (!testDir.exists()) {
+      println("Fetching OpenJFX from "+sdkURL+"..")
+      IO.unzipURL(new URL(sdkURL), javaFxHome)
+      java.nio.file.Files.createDirectory(testDir.toPath)
+      println("Fetching OpenJFX done.")
+    } else {
+      println("Using OpenJFX from "+javaFxHome)
+    }
+
+    javaFxHome
+  }
+  catch {
+    case t: Throwable => fail("Could not load OpenJFX! Reason:" + t.getMessage)
+  }
+}
+
+val jfxModules = Seq("base","controls","fxml","graphics","media","swing","web")
+
+
+if (!useJavaFX) Seq() else javafx_versions._1 match {
+  case 7 =>
+    // TODO libraryDependencies
+    Seq(unmanagedJars in Compile += Attributed.blank(legacyJavaFX()))
+  case 8 =>
+    (if (useScalaOrScalaFX) Seq(libraryDependencies += "org.scalafx" %% "scalafx" % jfx_scalafx_version) else Seq()) ++
+    Seq(unmanagedJars in Compile += Attributed.blank(legacyJavaFX()))
+  case _ =>
+    Seq(
+      javaOptions in run ++= Seq(
+        "--module-path", (javaFxPath.value / ("javafx-sdk-" + jfx_sdk_version) / "lib").toString,
+        "--add-modules=" + jfxModules.map("javafx."+_).mkString(","))
+    ) ++
+      (if (useScalaOrScalaFX) Seq(libraryDependencies += "org.scalafx" % "scalafx_2.13" % jfx_scalafx_version) else Seq()) ++
+      jfxModules.map(module => libraryDependencies += "org.openjfx" % ("javafx-"+module) % jfx_sdk_version classifier osName.value)
+}
diff --git a/distributed-gorilla-master/doc/index.md b/distributed-gorilla-master/doc/index.md
new file mode 100644
index 0000000000000000000000000000000000000000..f21e81e893e65471004090c2531fb2bb6aee0ae9
--- /dev/null
+++ b/distributed-gorilla-master/doc/index.md
@@ -0,0 +1,68 @@
+# Ohjelmarungon tuonti Eclipseen
+Kloonaa ja tuo projekti Eclipseen käyttämällä Eclipsen Smart Import -työkalua. Ohjattu toiminto löytyy valikosta File > Import > Git > Projects from Git (Smart Import). Toiminto kloonaa projektin koneellesi sekä tuo projektin Eclipseen Maven-konfiguraation mukaisesti. Jos ajat ohjelman Eclipsessä käyttäen "Java Application" -kohtaa, valitse Main-metodiksi `Main - fi.utu.tech.distributed.gorilla`.
+
+# Pelin toiminta
+Pelin säännöt ovat yksinkertaiset: kentällä on n gorillaa, jotka heittelevät banaaneja tietyssä kulmassa tietyllä nopeudella toisiaan päin. Mikäli banaani osuu, gorilla kuolee. Viimeinen eloonjäänyt gorilla on voittaja. Peli on jaettu aikarajoitettuihin kierroksiin, jonka aikana kaikki pelaajat päättävät siirtonsa. Kierroksen lopuksi (aika päättynyt tai kaikki gorillat ovat tehneet siirtonsa) gorillat heittävät banaaninsa yhtäaikaisesti. Kierroksen aikana pelissä on aina tietty sää (esimerkiksi tuuli), joka vaikuttaa heittoon.
+
+Käynnistyessään peli toistaa lyhyen Intron ja siirtyy tämän jälkeen valikkotilaan, ellei käyttäjä tätä ennen pakota tilanmuutosta käyttöliittymän painikkeilla.
+
+## Kontrollit
+Peliä ohjataan graafisen käyttöliittymän painikkeilla, näppäimistöllä sekä tekstipohjaisilla komennoilla.
+
+### Päävalikon kontrollit
+- Nuolinäppäimet + Enter
+
+Huomioi, että päävalikon kontrollit **eivät toimi**, mikäli tekstinsyöttökenttä on valittuna! Napsauta tulostekenttää, jotta fokus siirtyy pois syöttökentästä.
+
+
+### Alaosan painikkeet
+- Intro: Käynnistä pelin intro uudelleen
+- Menu: Siirry suoraan päävalikkon
+- Game: Siirry pelitilaan esimerkiksi päävalikosta tai introsta
+- <<, =, >>: Pysäytä kamera tai ohjaa sitä vasemmalle tai oikealle
+- 0: Kohdista kamera omaan pelaajaan
+- Restart: Käynnistä koko peli uudelleen - kova restart, sillä koko logiikka alustetaan
+- Exit: Poistu pelistä
+
+### Komennot
+Komennot syötetään oikean alakulman tekstikenttään. 
+- q, quit, exit: Poistu ohjelmasta
+- s, chat, say *viesti*: Puhu chattiin
+- a, k, angle, kulma: Aseta heittokulma asteina
+- v, n, velocity, nopeus: Aseta heittonopeus ja heitä banaani
+
+# Tehtävänanto
+Tässä harjoitustyössä on kolme päätehtävää, joista ensimmäinen on ohjelmointiharjoitus ja kaksi viimeistä selvitystehtäviä. Kahteen viimeiseen vastaukset kirjoitetaan [SELVITYS.md-tidostoon](../SELVITYS.md) pääkansiossa. Selvitystehtävät kannattaa tehdä ohjelmointitehtävän jälkeen.
+
+Tehtävät:
+1. Toteuta moninpeli (ml. chat) annettuun Gorillapeliin käyttämällä Mesh-tyylistä[^1] verkotusta applikaatiotasolla
+2. Mesh-toteutus on mahdollista toteuttaa nopeasti käyttäen Javan ObjectStreameja, jolloin verkon yli välittyy yksittäisiä serialisoituja olioita. Tämä on kuitenkin abstraktion luoma "illuusio", sillä TCP-socketit kuljettavat matalammalla tasolla pelkkää datavirtaa, eivätkä siis pysty erottamaan missä kohtaa serialisoitu olio päättyy ja mistä seuraava alkaa. Oletetaan olevan yksittäisiä resursseja, kuten serialisoituja olioita, jotka halutaan kuljettaa verkon yli, ilman olemassa olevaa ObjectStreamin kaltaista abstraktiota. Miten viestitte/merkkaatte vastaanottajalle yksittäisten resurssien rajat? (Vinkki: Voitte selvittää, miten osa olemassa olevista protokollista ratkaisee tämän ongelman.)
+3. Kerro lyhyesti muutama esimerkkiskenaario, mitä tietoturvaan liittyviä ongelmia Mesh-viestien välitys epäluotettujen solmujen kautta (eli siis toisten pelaajien, mahdollisesti toisen ohjelmabinäärin kautta) tuottaa ja miten ongelmia olisi mahdollista ratkaista.[^2] (Vinkki: digital signature, public key cryptography, Diffie–Hellman key exchange). Vastauksessa ei tarvitse keskittyä salausalgoritmien sisäiseen toimintaan/matemaattiseen teoriaan. 
+
+## Ensimmäisen tehtävän vaiheet ja haasteet
+Ensimmäinen tehtävä on tehtävistä aikaavievin ja täten pilkottu kolmeen vaiheeseen helpottamaan työssä etenemistä. Näitä vaiheita ei tarvitse palauttaa erikseen tai muutoin eritellä. Riittää, että lopullinen ohjelma palautetaan. Jossakin vaiheessa saattaa olla tarpeen myös muokata edellisessä vaiheessa kirjoitettua koodia, mutta tässä esitetty järjestys auttaa kuitenkin suunnittelemaan oman työn aikataulutusta.
+
+### Mesh-verkkokerroksen rakentaminen (35%)
+Mesh-kerroksen tulisi olla irrallaan pelitoiminnalisuudesta (ts. sen luokkien ei tulisi riippua Gorillaluokista). Sen tehtäväksi siis jää pelkästään datan lähettäminen, välittäminen ja vastaanottaminen (ilman duplikaatteja) muilta solmuilta ("nodeilta"). Myöhemmissä vaiheessa moninpeli toteutetaan tämän Mesh-kerroksen päälle. Haasteena tässä vaiheessa on opetella luomaan ja käyttämään säikeitä sockettien ja Input- ja OutputStreamien kanssa, sekä harjoittaa säikeiden välistä synkronointia ja säieturvallisten rakenteiden käyttöä. Tämän lisäksi on päätettävä, missä muodossa Mesh-viestit välitetään verkon yli (mitä otsakedataa viesteihin liitetään) ja miten ne serialisoidaan.
+
+Tarkemmin Mesh-verkosta, vaatimuksista sekä ehdotetusta toteutuksesta on kerrottu [omalla sivullansa](mesh.md).
+
+### Chatin toimintaansaatto käyttäen Mesh-toteutusta (15 %)
+Käytetään edellisen vaiheen Mesh-toteutusta pelin Chat-viestien välittämiseen. Haasteena on tutustua pelin ohjelmarunkoon riittävästi, jotta Mesh-palvelin saadaan käynnistettyä sekä yhdistettyä olemassa olevaan Mesh-verkkoon ja `ChatMessage`-oliot lähetettyä käyttöliittymää käyttäen. Myös vastaanotetut Chat-viestit tulee saada tulostettua vastaanottajan päässä. Riittää, että viestit saadaan lähetettyä kaikille (yksityisviestitukea ei tarvitse implementoida).
+
+Ohjelman kulkua, sekä tarkemmat vaatimukset on selvitetty [omalla sivullansa](program-flow-chat.md).
+
+### Joulu
+Joululoman alkaessa olisi hyvä, että vähintään Mesh-toteutus olisi jotakuinkin toiminnassa. Chat-toiminnallisuuden lisääminen ei tähän päälle ole aikataulullisesti iso tehtävä.
+
+### Pelin toimintaansaatto (50 %)
+Pelin loppuosan toimintaansaatto on suurin yksittäinen osakokonaisuus. Tässä laajennetaan verkkotoiminnallisuus koko peliin käyttäen hyväksi edellisssä Chatin implementoinnissa opittuja tekniikoita. Haasteena on osata välittää dataa käyttöliittymäsäikeelle säieturvallisesti ilman, että käyttöliittymäsäie jumiutuu tai tietorakenteet rikkoontuvat. On myös tärkeää selvittää, mitkä oliot tulee siirtää verkon ylitse, ja mitkä puolestaan pystytään johtamaan pienemmästä määrästä dataa.
+
+Tarkempi ohjeistus [omalla sivullansa](mesh-to-game.md).
+
+Huomatkaa vielä kerran, että tämä tehtävä on melko laaja ja sisältää paljon eri osia. Tämän vuoksi on ensiarvoisen tärkeää aloittaa tehtävän teko **nyt** ja kysyä tarvittaessa neuvoa tai varmistusta omalle ratkaisulle harjoitustyöpajoissa!
+
+[^1]: Verkko, johon uusi jäsen voi liittyä kenen tahansa jäsenen kautta. Tästä tarkemmin Mesh-verkon toteutuksesta puhuttaessa.
+[^2]: Mikäli kiinnostut enemmän, ks. [distributed-crypto](https://gitlab.utu.fi/tech/education/distributed-systems/distributed-crypto)
+
+*Tämän pelin kehityksen aikana ei vahingoitettu oikeita gorilloja. Muutama koodiapina on tosin saattanut menettää yöuniaan.*
diff --git a/distributed-gorilla-master/doc/mesh-to-game.md b/distributed-gorilla-master/doc/mesh-to-game.md
new file mode 100644
index 0000000000000000000000000000000000000000..02750ad8c444e567219b3a1be4e89fbcfe729706
--- /dev/null
+++ b/distributed-gorilla-master/doc/mesh-to-game.md
@@ -0,0 +1,48 @@
+# Moninpelin toteutus Mesh-verkon päälle
+
+## Vaatimukset
+- Toisessa osakokonaisuudessa implementoidun Chatin tulostus tulee siirtää JavaFX-säikeeseen
+- Meshin työskentelijäsäikiden tulee kommunikoida säieturvallisen rakenteen läpi JavaFX-säikeelle (Vinkki: threadrunner-tehtävän 4. selvitystehtävä...)
+- JavaFX-säiettä ei saa blokata tiedon vastaanottamisen aikana. Lähettämisen saa tehdä JavaFX-säikeestä
+- Mikäli jokin joukko pelaajista lähtee pois pelistä, tapausta ei tarvitse käsitellä. Pelissä on toki "luovutussiirto", mutta tätä ei tarvitse implementoida.
+- Moninpeli tulee pystyä pelaamaan läpi (banaaneja pitää pystyä heittämään)
+- Jokaisen pelaajan gorilla tulee olla samassa sijainnissa ja saman pelaajan kontrolloima kaikkien pelaajien näkymässä
+- Tietoa, joka voidaan johtaa siemenluvusta, ei tule välittää verkon ylitse
+
+## Luokat
+Luokkarakennetta avattiin jo aiemmin [chatin integrointitehtävän](program-flow-chat.md) yhteydessä. Tässä selostuksessa keskityttiin enemmän käyttöliittymälogiikkaan (`GorillaLogic`-luokka) kuin pelilogiikkaan, johon loput luokat liittyvät enemmissä määrin. Luokkien metodit on dokumentoitu Javadoc-tyylisesti, mutta tässä vielä lyhyet kuvaukset luokkien käyttötarkoituksista:
+
+### GorillaLogic
+Sisältää käyttöliittymälogiikan: Eli mitä tapahtuu kun tietty komento annetaan, milloin suoritetaan peliä ja milloin valikkoa, mitä tapahtuu kun aloitetaan moninpeli jne. Kutsuu tick-metodissa myös pelitilan (`GameState`) `tick()`-metodia. Luokka jäsennelty siten, että perittäessä oleellisten funktioiden uudelleenmäärittely on helppoa: Komennot kutsuvat `handleKomennonNimi()` -tyylisiä metodeita, jotka on mahdollista perivässä luokassa yliajaa.
+
+### GameState
+Sisältää pelin tilan ja metodit, joilla tilaa muutetaan. `GorillaLogic`-luokan kutsuma `tick()`-metodi päivittää pelin sisäistä ajan etenemistä. Pelin alkutila määritetään `GameConfiguration`-oliolla ja sen pohjalta luoduin pelaajaobjektein. Luokkaan on lisätty toinen, käyttämätön konstruktori, josta saattaa olla apua moninpelin toteutuksessa.
+
+### GameConfiguration
+Sisältää tarvittavat tiedot identtisen pelitilan luontiin. Identtisellä pelikonfiguraatiolla tulisi saada tuotettua identtinen pelitila, joka myös etenee deterministisesti. [^1] Luokkaan on lisätty toinen, käyttämätön konstruktori, josta saattaa olla apua moninpelin toteutuksessa.
+
+### GameWorld
+Sisältää pelitilan luoman pelimaailman (rakennusten, gorillojen sijainnit yms.)
+
+### Player
+Pelaajan tiedot, kuten nimen ja tämän siirrot sisältävä luokka. Pelaajaoliot voidaan luoda `GameConfiguration`-luokan nimilistan pohjalta.
+
+
+[^1]: GameConfiguration-oliossa on mukana siemenluku, joka annetaan satunnaislukugeneraattorille => satunnaislukugeneraattori generoi identtisiä lukuja kaikissa solmuissa, generaattorin luomaa dataa käytetään pelimaailman tilan satunnaisoperaatiohin => sama, deterministinen pelimaailma kaikilla solmuilla
+
+## Vaiheet:
+Loppupelin toimintaansaatto on suurin implementoinnin osakokonaisuuksista, joten siihen kannattaa varata eniten aikaa. Tämän kokoisessa tehtävässä on hyvä jakaa tehtävä vielä pienempiin vaiheisiin. Mikäli alkuunpääsy tuntuu hankalalta, alla lista, jonka mukaan etenemistä kannattaa suunnitella:
+
+- Suositellaan perityn `GorillaMultiplayerLogic` -luokan toteuttamista, mikäli 2. kohdassa ei vielä luotu
+- Uuden tiedon saaminen Mesh-verkosta: Miten välittää Mesh-verkosta tietoa JavaFX-säikeeseen turvallisesti?
+    - Myös: Uuden tiedon lukeminen JavaFX-säikeessä. Missä kohtaa uudet viestit voisi tarkistaa?
+- Siirretään Chatin tulostus Javafx-säikeeseen
+- Mitä tapahtuu, kun valitaan "Palvelinyhteys" valikosta?
+    - Kuka päättää GameConfigurationin sisällön?
+    - Miten ne, jotka eivät päätä GameConfigurationin sisältöä, liittyvät peliin?
+    - Miten nämä asiat viestitään verkon yli; Miten neuvottelu tapahtuu?
+- Identtisen pelitilan luonti
+- Miten pelaajien sijainnit yhdistetään solmuihin?
+- Miten siirrot siirretään verkon ylitse ja miten ne kohdistetaan oikeaan pelaajaan?
+
+Näiden osaongelmien ratkaisemisen jälkeen peli tulisi olla minimivaatimuksiltaan hyväksytty
\ No newline at end of file
diff --git a/distributed-gorilla-master/doc/mesh.md b/distributed-gorilla-master/doc/mesh.md
new file mode 100644
index 0000000000000000000000000000000000000000..dab4f1145b60960ee35995af1817eee4428eb214
--- /dev/null
+++ b/distributed-gorilla-master/doc/mesh.md
@@ -0,0 +1,112 @@
+# Mesh-verkko
+Mesh-verkon määritelmä tämän työn kontekstissa annetaan tässä dokumentissa. Älä käytä Googlea tai muuta hakukonetta määritelmän tarkentamiseen, sillä tässä esitelty malli on yksinkertaistettu versio verrattuna hakukoneitse löytyviin esimerkkeihin. Mikäli kaipaat tarkennusta johonkin kohtaan, lähetä viestiä kurssiassistenteille ([jastpa@utu.fi](mailto:jastpa@utu.fi) tai [jaanle@utu.fi](mailto:jaanle@utu.fi)) tai kysy harjoitustyöpajoissa.
+
+Mesh-toteutuksen luonnissa ei tulisi käyttää yhtäkään Gorillapelin luokkaa, vaan tarkoitus on toteuttaa geneerinen verkkokerros, joka pystyy välittämään dataa siihen liittyneiden solmujen kesken. Gorillapeli muokataan myöhemmissä vaiheissa käyttämään Mesh-toteutusta. Periaatteessa kehityksen ajaksi Main-luokan `main()`-metodista voi kommentoida graafisen käyttöliittymän käynnistymisen pois päältä ja testata Mesh-toteutusta ilman Gorillapelin käynnistystä. Itse mesh-toteutuksen luokat suositellaan toteuttamaan omassa pakkauksessaan, esimerkiksi fi.utu.tech.distributed.mesh.
+
+## Toimintakuvaus
+Mesh-verkko koostuu TCP-sokketteja kommunikaatiossa hyödyntävistä *solmuista* (ts. pelin kontekstissa solmut ovat eri koneilla käynnissä olevia gorillapelejä). Yksittäinen solmu sisältää niin asiakas- kuin palvelinkomponentitkin, joka mahdollistaa solmun niin yhdistävän toiseen solmuun kuin myös kuuntelevan toisten solmujen yhteydenottopyyntöjäkin. Jokainen solmu ottaa yhteyden vain yhteen aiemmin käynnistyneeseen solmuun, mutta yksittäiseen solmuun voivat useat solmut yhdistää. Tämä tekee verkon rakenteesta "puumaisen" (ks. kuva). 
+
+```mermaid
+graph BT
+A(Solmu 1)
+B("Solmu 2") -->  A
+C("Solmu 3") --> A
+D("Solmu 4") --> C
+E("Solmu 5") --> D
+F("Solmu 6") --> D
+G("Solmu 8") --> B
+H("Solmu 9") --> C
+```
+*Graafi eräästä Mesh-verkosta. Nuolet esittävät yhdistämissuuntaa, mutta kommunikaatio on kaksisuuntaista*
+
+Jotta solmu voi ottaa yhteyden muihin mesh-verkon solmuihin, täytyy se yhdistää verkkoon jonkun verkossa olevan solmun kautta. IP-osoite tällaiseen solmuun annetaan käyttäjän toimesta, eli muiden mekanismia solmujen etsimiseen ei tarvitse toteuttaa. Tämän lisäksi solmulle annetaan parametrina portti, johon serverikomponentti asetetaan kuuntelemaan toisten solmujen yhdistämispyyntöjä.
+
+Kun solmut on saatu yhdistettyä TCP-soketeilla toisiinsa, pitäisi viestejä pystyä lähettämään mille tahansa solmulle, joka on verkkoon yhdistänyt. Viestit voi yksinkertaisimmillaan välittää tulvimistekniikalla [(flooding)](https://en.wikipedia.org/wiki/Flooding_(computer_networking)), jolloin siis jokainen solmu vastaanottaessaan viestin, edelleenlähettää sen kaikille naapureillensa (ts. kaikille solmuille, jotka ovat tähän yhdistäneet sekä solmuun, johon tämä itse on yhdistänyt). Tällöin on tärkeää kehittää jokin mekanismi, jolla hillitään kontrolloimatonta viestitulvaa. Eräs tapa on pitää kirjaa, mitkä viestit on vastaanotettu aiemmin, jolloin viestien turha uudelleenlähetys toistamiseen voidaan estää. Tulvimistekniikalla läettäessä voidaan myös yksityisviestit toteuttaa viestiin liitettävän lähetystunnisteen avulla.
+
+## Vaatimukset
+- Toteutetaan TCP-socketeilla
+- Kaikkien solmujen tulee pystyä vastaanottamaan viestit kaikilta solmuilta
+- Yhden solmun tulee tukea useaa tähän yhdistävää solmua säieturvallisesti
+- Viesti tulee pystyä kohdistamaan tietylle solmulle
+- Solmujen tulee suodattaa duplikaattiviestit sekä heille kuulumattomat viestit vastaanottaessa, eikä paljastaa niitä Mesh-verkkoa käyttävälle ohjelmalle
+- Liitosten ei tarvitse olla redudantteja: Tilanteessa, jossa vertainen häviää verkosta, sallitaan, että kaikki tämän vertaisen kautta yhteydessä olevat irtoavat myös Mesh-verkosta
+- Mesh-kerroksen tulee luovuttaa vastaanotettu validi, solmulle kuuluva tieto, Mesh-verkkoa käyttävälle ohjelmalle (ts. pelille) säieturvallisesti (Tämä selkenee paremmin 3. aliosiossa)
+
+## Vihjeitä työn implementointiin
+
+### Vinkki 1
+Mesh-verkkototeutukseen riittää todennäköisesti 3 luokkaa: Yhteyspyyntöjä odottava ja julkisen APIn tarjoava palvelinluokka/pääluokka, vertaiskommunikaatiosta huolehtiva luokka (voi olla sisäluokka, "inner class") sekä Mesh-viestiluokka, jossa lähetettävä tieto kuljetetaan verkon ylise: sisältää viestin otsaketiedot, sekä itse hyötykuorman.
+
+### Vinkki 2
+Vertaisten ei tarvitse olla erityisen älykkäitä viestien edelleenvälityksessä. Toisin sanoen, vastaanotetun viestin riittää lähettää eteenpäin kaikille naapureille, mikäli se on vastaanotettu ensimmäistä kertaa. On vastaanottajan vastuulla hylätä viesti, joka on jo nähty tai muuten kelvoton.
+
+### Vinkki 3
+Mesh-verkkototeutuksen pääluokka voisi näyttää seuraavalle:
+
+```java
+public class Mesh {
+    /**
+     * Luo Mesh-palvelininstanssi
+     * @param port Portti, jossa uusien vertaisten liittymispyyntöjä kuunnellaan
+     */
+    public Mesh(int port);
+  
+    /**
+     *  Käynnistä uusien vertaisten kuuntelusäie
+     */
+    public void run();
+
+    /**
+     * Lähetä hyötykuorma kaikille vastaanottajille
+     * @param o Lähetettävä hyötykuorma
+     */
+    public void broadcast(Serializable o);
+
+    /**
+     * Lähetä hyötykuorma valitulle vertaiselle
+     * @param o Lähetettävä hyötykuorma
+     * @param recipient Vastaanottavan vertaisen tunnus
+     */
+    public void send(Serializable o, long recipient);
+
+    /**
+     * Sulje mesh-palvelin ja kaikki sen yhteydet 
+     */
+    public void close();
+
+    /**
+     * Lisää token, eli "viestitunniste"
+     * Käytännössä merkkaa viestin tällä tunnisteella luetuksi
+     * Määreenä private, koska tätä käyttävä luokka on sisäluokka (inner class)
+     * Jos et käytä sisäluokkaa, pitää olla public
+     * @param token Viestitunniste 
+     */
+    private void addToken(long token);
+
+    /**
+     * Tarkista, onko viestitunniste jo olemassa
+     * Määreenä private, koska tätä käyttävä luokka on sisäluokka (inner class)
+     * Jos et käytä sisäluokkaa, pitää olla public
+     * @param token Viestitunniste 
+     */
+    private boolean tokenExists(long token);
+
+    /**
+     * Yhdistä tämä vertainen olemassaolevaan Mesh-verkkoon
+     * @param addr Solmun ip-osoite, johon yhdistetään
+     * @param port Portti, jota vastapuolinen solmu kuuntelee
+     */
+    public void connect(InetAddress addr, int port);
+}
+```
+
+### Vinkki 4
+Mikäli alkuun pääseminen tuntuu haastavalta, aloita kopioimalla vinkin 3 luokkarakenne `Mesh.java` -tiedostoon ja toteuta luokka siihen asti, että pysyt `run()`-metodissa kuuntelemaan uusia yhteyspyyntöjä.
+
+Kuuntelijasäikeen lisäksi tarvitset luokan, jonka oliot kommunikoivat yhdistäneen asiakkaan kanssa. Ensialkuun riittää, että luot esimerkiksi `Handler`-nimisen luokan, jonka toteutat siihen asti, että se pystyy lukemaan socketeista olioita (kuten String) ja tulostamaan ne näytölle. Samaiseen luokkaan voit luoda myös send(String str) -metodin, joka puolestaan lähettäisi olioita socketin kautta.
+
+Vastaavat rakenteet löytyvät edelleen [distributed-chat -keskustelusovellusta](https://gitlab.utu.fi/tech/education/distributed-systems/distributed-chat) sekä [example-sockets-sivuilta](https://gitlab.utu.fi/tech/education/distributed-systems/example-sockets), josta voit ottaa mallia.
+
+### Vinkki 5
+Voit yhdistää omaan koneeseesi ottamalla yhteyttä ns. loopback-osoitteeseen 127.0.0.1, "localhost"
+
diff --git a/distributed-gorilla-master/doc/program-flow-chat.md b/distributed-gorilla-master/doc/program-flow-chat.md
new file mode 100644
index 0000000000000000000000000000000000000000..bb87f2306fdc75c990041c9118ad4705e0d6c3da
--- /dev/null
+++ b/distributed-gorilla-master/doc/program-flow-chat.md
@@ -0,0 +1,49 @@
+# Ohjelman kulku
+
+## Rakenne
+Pelin lähdekoodi on kokonaisuudessaan pakkauksen `fi.utu.tech.distributed.gorilla` alla, mutta se käyttää hyväkseen OOMkit-ohjelmistokehystä ja JavaFX:ää. Luokkien määrä saattaa ensialkuun tuntua massiiviselle, mutta sitä ei ole syytä pelästyä: Tämän työn suorittamisen kannalta oleellista ei ole tuntea kaikkia ohjelman mukana tulevia luokkia tai tuntea graafisten käyttöliittymien toimintaperiaatetta syvällisesti. Pelilogiikka on keskitetty pakkaukseen `fi.utu.tech.distributed.gorilla.logic`, jonka luokkia muokkaamalla ja lisäämällä tehtävänannon vaatimukset pystyy täyttämään.
+
+## Kulku
+Ohjelman suoritus käynnistyy `Main`-luokan main-metodista ohjelman pääsäikeessä. Main-metodin ainut tehtävä tässä ohjelmassa on käynnistää graafinen käyttöliittymä JavaFX:n sovellussäikeeseen (JavaFX Application Thread) käyttäen JavaFX:n `launch()` -metodia. JavaFX:n sovellussäie on vastuussa graafisen käyttöliittymän päivittämisestä. Se siis ajaa silmukassa esimerkiksi tapahtumankäsittelyä (tarkistaa, mitä nappeja käyttäjä painaa ja ohjaa tiedon kuunteleville komponenteille) ja ikkunan sisällön piirrosta vastaavia metodeita. Itse renderöinti on toteutettu ulkoisessa säikeessä, mutta sillä ei ole merkitystä tämän tehtävän kontekstissa.
+
+`App`-luokka on graafisen käyttöliittymän "entry point", joka annetaan main-metodin kutsumalle `launch()`-metodille parametrina. Itse luokka sisältää muutamia ohjelman käyttöliittymään lisättäviä painikkeita, mutta paljon toiminnallisuutta on myös piilotettu perittyyn oomkitin OOMApp-luokkaan. Tämän kurssin kontekstissa riittää ymmärtää, että App-luokka (tarkemmin OOMApp) lopulta kutsuu `GorillaLogic`-luokan `initialize()`-metodia, josta ohjelmalogiikkaa kannattaa aloittaa tarkistelemaan. `initialize()`-metodin vastakohtana voidaan pitää `terminate()`-metodia, jota kutsutaan automaattisesti suljettaessa peli-ikkuna. Tämän tiedon pohjalta on mahdollista löytää koodista paikka, jossa mesh-järjestelmä tulisi käynnistää.
+
+Tutkimalla alla olevaa graafia ohjelman toiminnan kulusta sekä samalla seuraamalla ohjelmakoodia, on mahdollista pienellä vaivalla löytää chat-viestien lähettämiselle sopiva paikka. `GorillaLogic` -luokan muokkaamisen sijaan voi halutessaan periä kyseisen luokan `GorillaMultiplayerLogic`-luokaksi ja tehdä kaikki muutokset tähän luokkaan. Tällöin `GorillaLogic` pysyy muuttumattomana. `GorillaMultiplayerLogic` tulee muistaa ottaa käyttöön `App`-luokassa!
+
+
+```mermaid
+graph TB
+
+  MainMain -- "launch(App)" --> AppStart
+  subgraph "JavaFX Application Thread"
+  AppStart("App.start()")
+  GorillaLogicInitialize("GorillaLogic.initialize()")
+  GorillaLogicTick("GorillaLogic.tick()")
+  GorillaLogicHandleInput("GorillaLogic.handleConsoleInput()")
+  GorillaLogicToggleGameMode("GorillaLogic.toggleGameMode()")
+  GorillaLogicMoveAI("GorillaLogic.moveAIplayers()")
+  GameState.tick("GameState.tick()")
+  ViewsRedraw("views.redraw()")
+  AppStart --> GorillaLogicInitialize
+  AppStart --> GorillaLogicTick
+  GorillaLogicTick -- loop --> GorillaLogicTick
+  GorillaLogicTick --> GorillaLogicHandleInput
+  GorillaLogicTick --> GorillaLogicToggleGameMode
+  GorillaLogicToggleGameMode -- if in Game mode --> GorillaLogicMoveAI
+  GorillaLogicToggleGameMode -- if in Game mode --> GameState.tick
+  GorillaLogicTick --> ViewsRedraw
+  end
+
+  subgraph "Main Thread"
+  MainMain("Main.main()")
+  end
+```
+*Ohjelman kulku työn kannalta oleellisilta osin (Renderöityy GitLabissa)*
+
+# Chat-viestiominaisuuden vaatimukset (2. osio)
+- Ohjelma osaa lähettää Chat-viestin kaikille mesh-verkossa `ChatMessage`-oliossa
+- Viesti lähetetään käyttäen say-komentoa pelin konsolissa
+- Viesti tulostuu kaikilla käyttäjillä ainoastaan kerran (Tämä tulisi olla jo Mesh-tasolla hoidettu!)
+- Viesti saadaan purkaa tässä vaiheessa Mesh-serverillä ja tulostaa konsoliin.[^1] Korjattava viim. 3. kohdassa!
+
+[^1]: Vastaanottaessa Chat-viestejä, riittää aluksi tulostaa viestit suoraan konsoliin vastaanottaessa. Kuitenkin kannattaa alkaa miettimään, miten tulostuksen voisi hoitaa `Gorilla(Multiplayer)Logic`-luokan sisässä, sillä Chat-viestien tulostaminen edellyttää `*.gorilla.logic`-pakkauksen luokkia, joista emme Mesh-toteutuksessa halua pidemmän päälle riippua. Toiseksi, muut JavaFX-säikeen rakenteet eivät välttämättä ole yhtä suopeita, mikäli ulkoiset säikeet sorkkivat tietorakenteita.
diff --git a/distributed-gorilla-master/pom.xml b/distributed-gorilla-master/pom.xml
new file mode 100644
index 0000000000000000000000000000000000000000..fac367f07a0d9369620f5d0526fb87712b88952d
--- /dev/null
+++ b/distributed-gorilla-master/pom.xml
@@ -0,0 +1,475 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <!--
+     
+      Welcome!
+      This pom.xml is *THE* file that defines your Maven style Java project.
+      
+      Eclipse, IDEA and other development environments with Maven support
+      or plugins can *import* this project by reading this file.
+      
+      It usually contains tons of barely readable configuration. Luckily
+      this basic pom.xml is somewhat readable. All necessary configuration
+      for customizing your project if located here on top before the
+      'END OF SIMPLE CONFIGURATION' line below.
+      
+      Some basics:
+      
+        - Maven is a build system for Java/JVM
+        - the Maven projects define an artifact that has a three part id:
+          groupId - artifactId - version
+          
+        - For example, this project is called:
+          fi.utu.tech - distributed-gorilla - 1.0
+          
+        - The group id is usually a web domain in reverse order.
+          
+        - You can use these id parts to search for projects at
+          https://search.maven.org/
+          
+        - If your version is not final and you have plans to modify the
+          source code at some point, please use a version id that ends with
+          -SNAPSHOT, e.g 1.0-SNAPSHOT. Maven may cache the project jar
+          and refuse to overwrite old cached versions with new ones unless
+          you remember this convention.
+          
+        - This file supports
+          compiling the project with      'mvn compile' (see target/)
+          cleaning the class files with   'mvn clean'
+          executing the main routine with 'mvn exec:java'
+          executing the unit tests with   'mvn test'
+          packaging the application with  'mvn package' (see target/)
+          
+        - the Maven project structure is as follows:
+          https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
+          
+    -->
+    
+    <!-- ==== START OF SIMPLE CONFIGURATION ==== -->
+    
+    <!-- the three parts of the artifact name -->
+    <groupId>fi.utu.tech</groupId>
+    <artifactId>distributed-gorilla</artifactId>
+    <version>1.0</version>
+    
+    <!-- additional information about the project -->
+    <name>Gorilla game</name>
+    <url>https://gitlab.utu.fi/tech/education/distributed/distributed-gorilla</url>
+    
+    <packaging>jar</packaging>
+
+    <!-- HINT: More configuration here! -->
+    <properties>
+        <!-- Configures this project to use 'fi.utu.tech.AppMain' as its main class -->
+        <project.mainclass>fi.utu.tech.distributed.gorilla.Main</project.mainclass>
+        
+        <!-- Don't touch these unless you know what you're doing!
+        
+             For example, the source encoding should always be utf-8.
+             You're probably doing something stupid if you think it
+             should be a 8-bit code page in 2019. -->
+        <jdk.version>11</jdk.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <jqwik.version>1.2.0</jqwik.version>
+        <junit.version>5.5.2</junit.version>
+        <junitplatform.version>1.5.2</junitplatform.version>
+        <javafx.version>13</javafx.version>
+        <oomkit.version>1.21</oomkit.version>
+        <crypto.version>1.0</crypto.version>
+        <classloader.version>1.0</classloader.version>
+    </properties>
+
+    <!-- ==== END OF SIMPLE CONFIGURATION ==== -->
+    
+    <repositories>
+        <repository>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+            <id>central</id>
+            <name>Central Repository</name>
+            <url>https://repo.maven.apache.org/maven2</url>
+        </repository>
+        <repository>
+            <id>jcenter</id>
+            <name>jcenter</name>
+            <url>https://jcenter.bintray.com/</url>
+        </repository>
+        <!-- UTU repository -->
+        <repository>
+            <id>ftdev</id>
+            <name>ftdev</name>
+            <url>https://ftdev.utu.fi/maven2</url>
+        </repository>
+    </repositories>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-api</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-params</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.platform</groupId>
+            <artifactId>junit-platform-commons</artifactId>
+            <version>${junitplatform.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>net.jqwik</groupId>
+            <artifactId>jqwik</artifactId>
+            <version>${jqwik.version}</version>
+            <scope>test</scope>
+        </dependency><!--
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-migrationsupport</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.platform</groupId>
+            <artifactId>junit-platform-runner</artifactId>
+            <version>${junitplatform.version}</version>
+            <scope>test</scope>
+        </dependency> -->
+        
+        <!-- JavaFX (remove if not needed to speed up dep downloads)-->
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-base</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-controls</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-fxml</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-graphics</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-media</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-swing</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-web</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+        
+        <!-- UTU oomkit, yay -->
+        <dependency>
+            <groupId>fi.utu.tech</groupId>
+            <artifactId>oomkit</artifactId>
+            <version>${oomkit.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>fi.utu.tech</groupId>
+            <artifactId>distributed-crypto</artifactId>
+            <version>${crypto.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>fi.utu.tech</groupId>
+            <artifactId>distributed-classloader</artifactId>
+            <version>${classloader.version}</version>
+        </dependency>
+    </dependencies>
+  
+    <build>
+        <plugins>
+            <!-- Make a 'fat' jar, that is, jar that contains all its dependencies and runs as is.
+                 See: https://stackoverflow.com/a/57691362 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>2.3</version>
+                <executions>
+                <execution>
+                <phase>package</phase>
+                <goals>
+                    <goal>shade</goal>
+                </goals>
+                <configuration>
+                    <filters>
+                        <filter>
+                            <artifact>*:*</artifact>
+                            <excludes>
+                                <exclude>module-info.class</exclude>
+                                <exclude>META-INF/*.SF</exclude>
+                                <exclude>META-INF/*.DSA</exclude>
+                                <exclude>META-INF/*.RSA</exclude>
+                            </excludes>
+                        </filter>
+                    </filters>
+                    <!-- <minimizeJar>true</minimizeJar> -->
+                    <transformers>
+                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                            <mainClass>${project.mainclass}</mainClass>
+                        </transformer>
+                    </transformers>
+                </configuration>
+                </execution>
+                </executions>
+            </plugin>
+            <!--  -->
+        
+            <!-- Run this app with exec:java -->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>1.6.0</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <mainClass>${project.mainclass}</mainClass>
+                    <arguments>
+                        <argument>arg1</argument>
+                        <argument>arg2</argument>
+                    </arguments>
+                </configuration>
+            </plugin>
+            
+            <!-- Make the packaged jar executable -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>3.1.2</version>
+                <configuration>
+                  <!-- DO NOT include log4j.properties file in your Jar -->
+                  <excludes>
+                    <exclude>**/log4j.properties</exclude>
+                  </excludes>
+                  <archive>
+                    <manifest>
+                        <!-- Jar file entry point -->
+                        <mainClass>${project.mainclass}</mainClass>
+                    </manifest>
+                  </archive>
+                </configuration>
+            </plugin>
+            
+            <!-- download source code in Eclipse, best practice -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <version>2.10</version>
+                <configuration>
+                    <downloadSources>true</downloadSources>
+                    <downloadJavadocs>false</downloadJavadocs>
+                </configuration>
+            </plugin>
+            
+            <!-- JDK source/target versions -->
+            <plugin>    
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.1</version>
+                <configuration>
+                    <compilerArgument>-Xlint:unchecked</compilerArgument>
+                    <source>${jdk.version}</source>
+                    <target>${jdk.version}</target>
+                </configuration>
+            </plugin>
+            
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>3.1.0</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.1.1</version>
+                <executions>
+                    <execution>
+                    <id>attach-javadocs</id>
+                    <goals>
+                        <goal>jar</goal>
+                    </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <tags>
+                        <tag>
+                            <name>toDo</name>
+                            <placement>a</placement>
+                            <head>To&nbsp;do:</head>
+                        </tag>
+                        <tag>
+                            <name>classInvariant</name>
+                            <placement>t</placement>
+                            <head>Class&nbsp;invariant:</head>
+                        </tag>
+                        <tag>
+                            <name>classInvariantProtected</name>
+                            <placement>t</placement>
+                            <head>Protected&nbsp;class&nbsp;invariant:</head>
+                        </tag>
+                        <tag>
+                            <name>classInvariantPrivate</name>
+                            <placement>t</placement>
+                            <head>Private&nbsp;class&nbsp;invariant:</head>
+                        </tag>
+                        <tag>
+                            <name>abstractionFunction</name>
+                            <placement>t</placement>
+                            <head>Abstraction&nbsp;function:</head>
+                        </tag>
+                        <tag>
+                            <name>pre</name>
+                            <placement>cm</placement>
+                            <head>Precondition:</head>
+                        </tag>
+                        <tag>
+                            <name>post</name>
+                            <placement>cm</placement>
+                            <head>Postcondition:</head>
+                        </tag>
+                        <tag>
+                            <name>postProtected</name>
+                            <placement>cm</placement>
+                            <head>Protected&nbsp;postcondition:</head>
+                        </tag>
+                        <tag>
+                            <name>postPrivate</name>
+                            <placement>cm</placement>
+                            <head>Private&nbsp;postcondition:</head>
+                        </tag>
+                        <tag>
+                            <name>time</name>
+                            <placement>cmf</placement>
+                            <head>Time&nbsp;complexity:</head>
+                        </tag>
+                        <tag>
+                            <name>space</name>
+                            <placement>cmf</placement>
+                            <head>Space&nbsp;complexity:</head>
+                        </tag>
+                        <tag>
+                            <name>correspondence</name>
+                            <placement>a</placement>
+                            <head>Correspondence:</head>
+                        </tag>
+                        <tag>
+                            <name>download</name>
+                            <placement>a</placement>
+                            <head>Download:</head>
+                        </tag>
+                    </tags>
+                    <show>protected</show>
+                    <failOnError>false</failOnError>
+                    <sourceFileExcludes>
+                        <sourceFileExclude>**/module-info.java</sourceFileExclude>
+                    </sourceFileExcludes>
+                </configuration>
+            </plugin>
+            
+            <!-- JUnit & JQwik test integration -->
+            
+            <!-- junit-platform-maven-plugin: supports modular tests
+                 maven-surefire-plugin: non-modular tests
+                 
+                 Modular testing works via command line mvn, but is
+                 still broken in Eclipse due to this
+                 https://bugs.eclipse.org/bugs/show_bug.cgi?id=520667
+              -->
+            <plugin>
+                <groupId>de.sormuras.junit</groupId>
+                <artifactId>junit-platform-maven-plugin</artifactId>
+                <version>1.0.0-M5</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <executor>JAVA</executor>
+                </configuration>
+            </plugin>
+            
+            <!--
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>3.0.0-M3</version>
+            </plugin>
+            <plugin>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <version>3.0.0-M3</version>
+            </plugin> -->
+            
+            <!-- javafx:jlink: 
+                 https://github.com/openjfx/javafx-maven-plugin
+                 Use 'mvn package' instead if you don't need jlink.
+            
+            <plugin>
+                <groupId>org.openjfx</groupId>
+                <artifactId>javafx-maven-plugin</artifactId>
+                <version>0.0.3</version>
+                <configuration>
+                    <mainClass>${project.mainclass}</mainClass>
+                </configuration>
+            </plugin> -->
+
+        </plugins>
+        <extensions>
+            <!-- Enables the use of SSH for deployments -->
+            <extension>
+                <groupId>org.apache.maven.wagon</groupId>
+                <artifactId>wagon-ssh-external</artifactId>
+                <version>3.3.3</version>
+            </extension>
+            <extension>
+                <groupId>org.apache.maven.wagon</groupId>
+                <artifactId>wagon-ssh</artifactId>
+                <version>3.3.3</version>
+            </extension>
+        </extensions>
+    </build>
+    <distributionManagement>
+        <!-- where to deploy the package -->
+        <repository>
+            <id>localhost</id>
+            <name>Local computer</name>
+            <url>scp://localhost/tmp</url>
+        </repository>
+    </distributionManagement>
+</project>
diff --git a/distributed-gorilla-master/project/build.properties b/distributed-gorilla-master/project/build.properties
new file mode 100644
index 0000000000000000000000000000000000000000..6adcdc753fdca1b4b851d8b75426dee24044bf6d
--- /dev/null
+++ b/distributed-gorilla-master/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.3.3
diff --git a/distributed-gorilla-master/project/plugins.sbt b/distributed-gorilla-master/project/plugins.sbt
new file mode 100644
index 0000000000000000000000000000000000000000..37ca261463b6a1800a62a0d5a5279fbb22915638
--- /dev/null
+++ b/distributed-gorilla-master/project/plugins.sbt
@@ -0,0 +1,7 @@
+resolvers += Resolver.jcenterRepo
+
+addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
+addSbtPlugin("net.aichler" % "sbt-jupiter-interface" % "0.8.3")
+addSbtPlugin("com.github.xuwei-k" % "sbt-jshell" % "0.1.2")
+//addSbtPlugin("org.xerial.sbt" % "sbt-sql-sqlite" % "0.8")
+addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.0")
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/App.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/App.java
new file mode 100644
index 0000000000000000000000000000000000000000..1e30d358b726b8e5716829d0ccfc323b112c14e3
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/App.java
@@ -0,0 +1,74 @@
+package fi.utu.tech.distributed.gorilla;
+
+import fi.utu.tech.distributed.gorilla.logic.GameMode;
+import fi.utu.tech.distributed.gorilla.logic.GorillaLogic;
+import fi.utu.tech.oomkit.app.OOMApp;
+import fi.utu.tech.oomkit.controls.Button;
+import fi.utu.tech.oomkit.controls.NodeList;
+import fi.utu.tech.oomkit.windows.Window;
+import javafx.scene.control.Label;
+import javafx.stage.Stage;
+
+/**
+ * Few things worth noting here:
+ *   - 'appLogic' will be initialized just before App is constructed (called by the main() thread)
+ *   - 'appLogic' has uninitialized fields pointing to GUI elements at this point
+ *
+ *   - at this point the main() thread will block, waiting for the JavaFX thread to finish
+ *   - thus, let's focus on the newly creating JavaFX thread, which becomes our foreground thread
+ *   - 'App' will first call appLogic.getCanvas and appLogic.configuration when constructing the GUI (called by the JavaFX thread)
+ *   - 'App' will later call appLogic.initialize when the GUI is ready (called by the JavaFX thread)
+ *
+ *   - at this point the 'App' has become active
+ *   - when the 'App' is active, it will periodically call appLogic.tick() (called by the JavaFX thread)
+ *   - when the 'App' is active and a key has been pressed, it will call appLogic.handleKey() (called by the JavaFX thread)
+ *   - when the 'App' is active and a button (see below) has been pressed, it will call appLogic.XXX (see below) (called by the JavaFX thread)
+ *
+ *   A simplified representation of the game loop looks like:
+ *   while(true) {
+ *       appLogic.tick();
+ *       if (system.keys_pressed) appLogic.handleKey();
+ *       if (system.gui_buttons_pressed) appLogic.XXX();
+ *       wait(a_short_duration);
+ *   }
+ *
+ *   The actual rendering to screen occurs in a JavaFX background thread. However, all delays in our
+ *   foreground JavaFX thread may cause stuttering or dropped frames (that is, something will be
+ *   rendered, but our rendering commands will miss the deadline and something partial will be drawn
+ *   instead).
+ */
+public class App extends OOMApp {
+    final static GorillaLogic appLogic = new GorillaLogic();
+
+    @Override
+    protected Window generateMainWindow(Stage stage, String appName, double width, double height) {
+        return new SimpleMainWindow(stage, appName, width < 1024 ? width : Math.min(width * 0.91, 1920), height < 768 ? height : Math.min(height * 0.91, 1080)) {
+            @Override
+            public NodeList bottomBarContent() {
+                return new NodeList(
+                        new Label("Some examples:"),
+                        new Button("Intro", e -> appLogic.setMode(GameMode.Intro)),
+                        new Button("Menu", e -> appLogic.setMode(GameMode.Menu)),
+                        new Button("Game", e -> appLogic.setMode(GameMode.Game)),
+                        new Button("<<", e -> appLogic.views.addVelocity(-5)),
+                        new Button("=", e -> appLogic.views.setVelocity(0)),
+                        new Button("0", e -> appLogic.views.focusOnMe()),
+                        new Button(">>", e -> appLogic.views.addVelocity(5))
+                ).cat(basicButtons());
+            }
+        };
+    }
+
+    /**
+     * Override if you need to execute stuff using the main() thread before the GUI launches.
+     */
+    @Override
+    public void init() {
+        report("javafx.runtime.version: " + System.getProperties().get("javafx.runtime.version"));
+        report("java version: " + System.getProperty("java.version"));
+    }
+
+    public App() {
+        super(appLogic);
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/AssetManager.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/AssetManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..808cd4e5c9fe64737ad5aad121696ae8662b351a
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/AssetManager.java
@@ -0,0 +1,36 @@
+package fi.utu.tech.distributed.gorilla;
+
+import fi.utu.tech.oomkit.util.ResourceLoader;
+import javafx.scene.image.Image;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+public class AssetManager {
+    private static AssetManager instance;
+    private static final Object lock = new Object();
+
+    public static AssetManager getInstance() {
+        synchronized (lock) {
+            return instance = (instance == null ? new AssetManager() : instance);
+        }
+    }
+
+    private final Map<String, Image> cache = new HashMap<>();
+
+    protected Image loadImage(String imgFile) {
+        try {
+            return ResourceLoader.loadImage(ResourceLoader.findResource(imgFile));
+        } catch (IOException e) {
+            e.printStackTrace();
+            System.exit(1);
+            return null;
+        }
+    }
+
+    public Image getImage(String name) {
+        cache.putIfAbsent(name, loadImage(name));
+        return cache.get(name);
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/Main.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/Main.java
new file mode 100644
index 0000000000000000000000000000000000000000..d4e7ea1772e6e593649266898e90949dc7fea321
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/Main.java
@@ -0,0 +1,11 @@
+package fi.utu.tech.distributed.gorilla;
+
+/**
+ * This is the main class. In order to launch JavaFX from an IDE, needs to call a different
+ * "Application" class (here App). Note, App.launch will block until the GUI application is closed.
+ */
+public class Main {
+    public static void main(String[] args) {
+        App.launch(App.class, args);
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Engine.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Engine.java
new file mode 100644
index 0000000000000000000000000000000000000000..7afae63250a2e92d2e495caf303ce516e6a75794
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Engine.java
@@ -0,0 +1,31 @@
+package fi.utu.tech.distributed.gorilla.engine;
+
+import java.util.Collection;
+import java.util.function.Consumer;
+
+public interface Engine {
+    void init();
+
+    void bindObject(ProxyGameObject g, boolean movable);
+
+    void unbind(ProxyGameObject g);
+
+    Collection<ProxyGameObject> objectsInRegion(Region region);
+
+    void handleObjectsInRegion(Region region, Consumer<ProxyGameObject> handler);
+
+    void run();
+
+    GameObject getEngineObject(ProxyGameObject g);
+
+    void updateObject(ProxyGameObject g);
+
+    double currentTimeStamp();
+
+    double timeStep();
+
+    default void runUntil(double timeStamp) {
+        while (currentTimeStamp() < timeStamp)
+            run();
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/GameObject.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/GameObject.java
new file mode 100644
index 0000000000000000000000000000000000000000..5f245f6d84cd291b786112a8f4e1090d37392596
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/GameObject.java
@@ -0,0 +1,42 @@
+package fi.utu.tech.distributed.gorilla.engine;
+
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+public interface GameObject {
+    int getId();
+
+    Point2D getAcceleration() ;
+
+    Point2D getVelocity();
+
+    Point2D getPosition();
+
+    Point2D getForm();
+
+    double getMass();
+
+    boolean isMovable();
+
+    void setId(int id);
+
+    void setAcceleration(Point2D a) ;
+
+    void setVelocity(Point2D v);
+
+    void setPosition(Point2D p);
+
+    void setForm(Point2D f);
+
+    void setMass(double m);
+
+    void setMovable(boolean movable);
+
+    default void setTo(GameObject other) {
+        getPosition().set(other.getPosition());
+        getVelocity().set(other.getVelocity());
+        getAcceleration().set(other.getAcceleration());
+        getForm().set(other.getForm());
+        setMass(other.getMass());
+        setMovable(other.isMovable());
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/GameObjectBase.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/GameObjectBase.java
new file mode 100644
index 0000000000000000000000000000000000000000..1d6ae0e92be4a82ea2bfb1e4786d7842753b2bb9
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/GameObjectBase.java
@@ -0,0 +1,98 @@
+package fi.utu.tech.distributed.gorilla.engine;
+
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+public abstract class GameObjectBase implements GameObject {
+    protected int id;
+    protected final Point2D position;
+    protected final Point2D velocity;
+    protected final Point2D acceleration;
+    protected final Point2D form;
+    protected double mass;
+    protected boolean movable;
+
+    public GameObjectBase(int id, Point2D position, Point2D velocity, Point2D acceleration, Point2D form, double mass, boolean movable) {
+        this.id = id;
+        this.acceleration = acceleration;
+        this.velocity = velocity;
+        this.position = position;
+        this.form = form;
+        this.mass = mass;
+        this.movable = movable;
+    }
+
+    public GameObjectBase(GameObject other) {
+        this(other.getId(), other.getPosition().copy(), other.getVelocity().copy(), other.getAcceleration().copy(), other.getForm().copy(), other.getMass(), other.isMovable());
+    }
+
+
+    @Override
+    public int getId() {
+        return id;
+    }
+
+    @Override
+    public Point2D getPosition() {
+        return position;
+    }
+
+    @Override
+    public Point2D getVelocity() {
+        return velocity;
+    }
+
+    @Override
+    public Point2D getAcceleration() {
+        return acceleration;
+    }
+
+    @Override
+    public Point2D getForm() {
+        return form;
+    }
+
+    @Override
+    public double getMass() {
+        return mass;
+    }
+
+    @Override
+    public boolean isMovable() {
+        return movable;
+    }
+
+    @Override
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    @Override
+    public void setPosition(Point2D pos) {
+        position.set(pos);
+    }
+
+    @Override
+    public void setVelocity(Point2D pos) {
+        velocity.set(pos);
+    }
+
+    @Override
+    public void setAcceleration(Point2D pos) {
+        acceleration.set(pos);
+    }
+
+    @Override
+    public void setForm(Point2D form) {
+        form.set(form);
+    }
+
+    @Override
+    public void setMovable(boolean movable) {
+        this.movable = movable;
+    }
+
+    @Override
+    public void setMass(double mass) {
+        this.mass = mass;
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/PhysicalObject.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/PhysicalObject.java
new file mode 100644
index 0000000000000000000000000000000000000000..70be71df2ae20ef70fc71733111c1350b073994f
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/PhysicalObject.java
@@ -0,0 +1,55 @@
+package fi.utu.tech.distributed.gorilla.engine;
+
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+class PhysicalObject extends GameObjectBase implements Region {
+    private final Point2D bottomRight = new Point2D();
+    boolean collision = false;
+
+    @Override
+    public void setPosition(Point2D pos) {
+        position.set(pos);
+        bottomRight.set(pos).add(form);
+    }
+
+    @Override
+    public Point2D topLeft() {
+        return position;
+    }
+
+    @Override
+    public Point2D bottomRight() {
+        return bottomRight;
+    }
+
+    public PhysicalObject(GameObject gameObject, boolean movable) {
+        super(gameObject);
+        setPosition(getPosition());
+        setMovable(gameObject.isMovable() && movable);
+    }
+
+    @Override
+    public void setTo(GameObject gobj) {
+        setPosition(gobj.getPosition());
+        setVelocity(gobj.getVelocity());
+        setAcceleration(gobj.getAcceleration());
+        setForm(gobj.getForm());
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof PhysicalObject)) return false;
+        PhysicalObject that = (PhysicalObject) o;
+        return id == that.id;
+    }
+
+    @Override
+    public int hashCode() {
+        return id;
+    }
+
+    public String toString() {
+        return topLeft().toPoint() + " - " + bottomRight().toPoint() + " " + id;
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/ProxyGameObject.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/ProxyGameObject.java
new file mode 100644
index 0000000000000000000000000000000000000000..6bb400c873b5dce42102632b23d7657c2f26450e
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/ProxyGameObject.java
@@ -0,0 +1,60 @@
+package fi.utu.tech.distributed.gorilla.engine;
+
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+public abstract class ProxyGameObject extends GameObjectBase {
+    protected final Engine engine;
+
+    public ProxyGameObject(Engine engine, int id, Point2D position, Point2D velocity, Point2D acceleration, Point2D form, double mass, boolean movable) {
+        super(id, position, velocity, acceleration, form, mass, movable);
+        this.engine = engine;
+    }
+
+    public ProxyGameObject(Engine engine, Point2D position, Point2D velocity, Point2D form, double mass) {
+        this(engine, -1, position, velocity, new Point2D(), form, mass, true);
+    }
+
+    public abstract void draw(Canvas canvas, Point2D trans);
+
+    @Override
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    @Override
+    public void setPosition(Point2D pos) {
+        setTo(engine.getEngineObject(this));
+        super.setPosition(pos);
+        engine.updateObject(this);
+    }
+
+    @Override
+    public void setVelocity(Point2D v) {
+        setTo(engine.getEngineObject(this));
+        super.setVelocity(v);
+        engine.updateObject(this);
+    }
+
+    @Override
+    public void setAcceleration(Point2D a) {
+        setTo(engine.getEngineObject(this));
+        super.setAcceleration(a);
+        engine.updateObject(this);
+    }
+
+    @Override
+    public void setForm(Point2D form) {
+        setTo(engine.getEngineObject(this));
+        super.setForm(form);
+        engine.updateObject(this);
+    }
+
+    @Override
+    public void setMovable(boolean movable) {
+        super.setMovable(movable);
+        engine.updateObject(this);
+    }
+
+    protected boolean collideWith(ProxyGameObject other) { return false; }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Rect.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Rect.java
new file mode 100644
index 0000000000000000000000000000000000000000..c7a922f4250090750e0b7fc63566a2fce3efcdda
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Rect.java
@@ -0,0 +1,41 @@
+package fi.utu.tech.distributed.gorilla.engine;
+
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.Objects;
+
+public class Rect implements Region {
+    public final Point2D topLeft;
+    public final Point2D bottomRight;
+
+    public Rect(Point2D topLeft, Point2D bottomRight) {
+        this.topLeft = topLeft;
+        this.bottomRight = bottomRight;
+    }
+
+    public Point2D topLeft() {
+        return topLeft;
+    }
+
+    public Point2D bottomRight() {
+        return bottomRight;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof Rect)) return false;
+        Rect rect = (Rect) o;
+        return topLeft.equals(rect.topLeft) &&
+                bottomRight.equals(rect.bottomRight);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(topLeft, bottomRight);
+    }
+
+    public String toString() {
+        return topLeft().toPoint() + " - " + bottomRight().toPoint();
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Region.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Region.java
new file mode 100644
index 0000000000000000000000000000000000000000..a5a60a04233c7181d3fe5c4b2c6a571f4f536f7e
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/Region.java
@@ -0,0 +1,109 @@
+package fi.utu.tech.distributed.gorilla.engine;
+
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.Collection;
+
+public interface Region {
+    Point2D topLeft();
+
+    Point2D bottomRight();
+
+    private boolean testIntersection(Region other) {
+        if (other.contains(topLeft()) || other.contains(bottomRight()))
+            return true;
+
+        if (other.contains(topLeft().x, bottomRight().y)) return true;
+        return other.contains(bottomRight().x, topLeft().y);
+    }
+
+    default boolean intersectsWith(Region other) {
+        return other != null && (testIntersection(other) || other.testIntersection(this));
+    }
+
+    default double area() {
+        double dx = bottomRight().x - topLeft().x;
+        double dy = bottomRight().y - topLeft().y;
+
+        return dx * dy;
+    }
+/*
+    default Point2D center() {
+        return new Point2D(bottomRight()).sub(topLeft()).mul(0.5).add(topLeft());
+    }
+
+    default double distance(Region other) {
+        Point2D c = other.center().sub(center());
+        c.x *= c.x;
+        c.y *= c.y;
+        return c.x + c.y;
+
+    static Region union(Collection<? extends Region> regions) {
+        if (regions.isEmpty()) return null;
+
+        Region first = regions.iterator().next();
+        double lx, rx, ty, by;
+        {
+            assert(first != null);
+            assert(first.topLeft() != null);
+            double x = first.topLeft().x, y = first.topLeft().y;
+            lx = rx = x;
+            ty = by = y;
+        }
+        for (Region r : regions) {
+            if (lx > r.topLeft().x) lx = r.topLeft().x;
+            if (ty > r.topLeft().y) ty = r.topLeft().y;
+            if (rx < r.bottomRight().x) rx = r.bottomRight().x;
+            if (by < r.bottomRight().y) by = r.bottomRight().y;
+        }
+
+        return new Rect(new Point2D(lx, ty), new Point2D(rx, by));
+    }
+    default Region union(Region other) {
+        return union(List.of(this, other));
+    }
+    */
+
+    default Region unionN(Collection<? extends Region> regions) {
+        Region r1 = regions.iterator().next();
+        topLeft().set(r1.topLeft());
+        bottomRight().set(r1.bottomRight());
+        for (Region r : regions) {
+            topLeft().min(r.topLeft());
+            bottomRight().max(r.bottomRight());
+        }
+        return this;
+    }
+
+    default Region union2(Region r1, Region r2) {
+        topLeft().set(r1.topLeft());
+        bottomRight().set(r1.bottomRight());
+        topLeft().min(r2.topLeft());
+        bottomRight().max(r2.bottomRight());
+        return this;
+    }
+
+    default Region union(Region r) {
+        topLeft().min(r.topLeft());
+        bottomRight().max(r.bottomRight());
+        return this;
+    }
+
+    default boolean contains(Point2D point) {
+        return point.x >= topLeft().x &&
+                point.y >= topLeft().y &&
+                point.x <= bottomRight().x &&
+                point.y <= bottomRight().y;
+    }
+
+    default boolean contains(double x, double y) {
+        return x >= topLeft().x &&
+                y >= topLeft().y &&
+                x <= bottomRight().x &&
+                y <= bottomRight().y;
+    }
+
+    default boolean contains(Region other) {
+        return contains(other.bottomRight()) && contains(other.topLeft());
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/SimpleEngine.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/SimpleEngine.java
new file mode 100644
index 0000000000000000000000000000000000000000..b7eacea0132fa13fca1a491cf6cfb05ee6acb27a
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/SimpleEngine.java
@@ -0,0 +1,227 @@
+package fi.utu.tech.distributed.gorilla.engine;
+
+import fi.utu.tech.distributed.gorilla.engine.rtree.Root;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.function.Consumer;
+
+public class SimpleEngine implements Engine {
+    public final double height;
+    private final int maxObjects;
+    private final double timeStep;
+
+    private final ProxyGameObject[] slotToGameObject;
+    private final PhysicalObject[] state1;
+    private final PhysicalObject[] state2;
+    private final int[] mappingSlots;
+
+    private final Root<PhysicalObject> scene = new Root<>();
+    private final Point2D gravity = new Point2D(0, 9);
+
+    private boolean flip;
+    private int mappingSlotCursor;
+    private double timestamp;
+
+    public SimpleEngine(double height, int maxObjects, double timeStep) {
+        this.height = height;
+        this.maxObjects = maxObjects;
+        this.timeStep = timeStep;
+
+        slotToGameObject = new ProxyGameObject[maxObjects];
+        state1 = new PhysicalObject[maxObjects];
+        state2 = new PhysicalObject[maxObjects];
+        mappingSlots = new int[maxObjects];
+        init();
+    }
+
+    @Override
+    public void init() {
+        for (int i = 0; i < maxObjects; i++) {
+            mappingSlots[i] = i;
+            slotToGameObject[i] = null;
+            state1[i] = null;
+            state2[i] = null;
+        }
+        scene.clear();
+        mappingSlotCursor = 0;
+        timestamp = 0;
+    }
+
+    public GameObject getEngineObject(ProxyGameObject g) {
+        return g.getId() == -1 ? g : getObject(g.getId());
+    }
+
+    @Override
+    public void updateObject(ProxyGameObject g) {
+        if (g.getId() == -1) return;
+
+        PhysicalObject obj1 = getObject(g.getId());
+        PhysicalObject obj2 = getOther(g.getId());
+
+        obj1.setTo(g);
+        obj2.setTo(g);
+    }
+
+    @Override
+    public void bindObject(ProxyGameObject g, boolean movable) {
+        assert(g.getId() == -1);
+        int id = assignId();
+        assert (id >= 0 && id < maxObjects);
+        g.setId(id);
+        state1[id] = new PhysicalObject(g, movable);
+        state2[id] = new PhysicalObject(g, movable);
+        slotToGameObject[id] = g;
+        scene.add(getObject(id));
+    }
+
+    @Override
+    public void unbind(ProxyGameObject g) {
+        final int id = g.getId();
+        if (id == -1) return;
+        scene.remove(getObject(id));
+        freeId(id);
+        g.setId(-1);
+    }
+
+    // warning: slow
+    @Override
+    public Collection<ProxyGameObject> objectsInRegion(Region region) {
+        Collection<PhysicalObject> objs = scene.findIntersections(region);
+        Set<ProxyGameObject> gobjs = new HashSet<>();
+        for (PhysicalObject obj : objs) gobjs.add(slotToGameObject[obj.id]);
+        return gobjs;
+    }
+
+    private class SearchDispatcher implements Consumer<PhysicalObject> {
+        public Consumer<ProxyGameObject> handler;
+
+        @Override
+        public void accept(PhysicalObject obj) {
+            handler.accept(slotToGameObject[obj.id]);
+        }
+    }
+
+    private final SearchDispatcher searchDispatcher = new SearchDispatcher();
+
+    @Override
+    public void handleObjectsInRegion(Region region, Consumer<ProxyGameObject> handler) {
+        searchDispatcher.handler = handler;
+        scene.handleIntersections(region, searchDispatcher);
+    }
+
+    private int assignId() {
+        return mappingSlots[mappingSlotCursor++];
+    }
+
+    private void freeId(int id) {
+        for (int j = 0; j < mappingSlotCursor; j++)
+            if (mappingSlots[j] == id) {
+                mappingSlotCursor--;
+                mappingSlots[j] = mappingSlots[mappingSlotCursor];
+                mappingSlots[mappingSlotCursor] = id;
+                break;
+            }
+
+        state1[id] = null;
+        state2[id] = null;
+        slotToGameObject[id] = null;
+    }
+
+    private PhysicalObject getObject(int id) {
+        return flip ? state2[id] : state1[id];
+    }
+
+    private PhysicalObject getOther(int id) {
+        return flip ? state1[id] : state2[id];
+    }
+
+    private final Point2D tmp = new Point2D();
+
+    private class CollisionDispatcher implements Consumer<PhysicalObject> {
+        public ProxyGameObject active;
+
+        @Override
+        public void accept(PhysicalObject obj) {
+            if (active == null) return;
+
+            ProxyGameObject o = slotToGameObject[obj.id];
+            if (active != o) {
+                if (active.collideWith(o)) unbind(active);
+                if (o.collideWith(active)) unbind(o);
+            }
+        }
+    }
+
+    private final CollisionDispatcher collisionDispather = new CollisionDispatcher();
+
+    @Override
+    public double currentTimeStamp() { return timestamp; }
+
+    @Override
+    public double timeStep() {
+        return timeStep;
+    }
+
+    @Override
+    public void run() {
+        timestamp += timeStep;
+
+        flip = !flip;
+
+        for (int slot = 0; slot < mappingSlotCursor; slot++) {
+            int i = mappingSlots[slot];
+            final PhysicalObject src = getOther(i);
+            final PhysicalObject dst = getObject(i);
+            final ProxyGameObject gobj = slotToGameObject[i];
+            assert (gobj != null);
+
+            dst.mass = src.mass;
+            dst.movable = src.movable;
+
+            if (!src.movable) {
+                dst.position.set(src.position);
+                dst.acceleration.set(0, 0);
+                dst.velocity.set(0, 0);
+                continue;
+            }
+
+            if (dst.position.y > height) {
+                unbind(gobj);
+                continue;
+            }
+
+            tmp.set(src.acceleration);
+            if (src.mass>0) tmp.add(gravity);
+            tmp.mul(timeStep);
+            dst.acceleration.set(src.acceleration);
+            dst.velocity.set(tmp).mul(timeStep).add(src.velocity);
+            dst.position.set(src.velocity).mul(timeStep).add(src.position);
+            dst.setPosition(dst.position);
+
+            dst.collision = scene.intersectsWith(dst);
+
+            if (dst.collision) {
+                collisionDispather.active = gobj;
+                scene.handleIntersections(dst, collisionDispather);
+
+                if (slotToGameObject[i] == null) continue;
+
+                if (!gobj.movable) {
+                    dst.setPosition(src.position);
+                    dst.acceleration.set(0, 0);
+                    dst.velocity.set(0, 0);
+                } else {
+                    scene.remove(src);
+                    scene.add(dst);
+                }
+            }
+
+            gobj.getPosition().set(dst.position);
+            gobj.getVelocity().set(dst.velocity);
+            gobj.getAcceleration().set(dst.acceleration);
+        }
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Leaf.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Leaf.java
new file mode 100644
index 0000000000000000000000000000000000000000..c30899d5ea31bfb4eced40e28b81f3202fa71b84
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Leaf.java
@@ -0,0 +1,59 @@
+package fi.utu.tech.distributed.gorilla.engine.rtree;
+
+import fi.utu.tech.distributed.gorilla.engine.Region;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.function.Consumer;
+
+public class Leaf<X extends Region> extends Node<X> {
+    public final X object;
+    private final Set<X> set;
+
+    public Leaf(X obj) {
+        object = obj;
+        set = Set.of(object);
+        setRegion(obj);
+    }
+
+    @Override
+    public Collection<X> findIntersections(Region region) {
+        if (object.intersectsWith(region)) return set;
+        return Set.of();
+    }
+
+    @Override
+    public void handleIntersections(Region region, Consumer<X> handler) {
+        if (object.intersectsWith(region)) handler.accept(object);
+    }
+
+    @Override
+    public boolean intersectsWith(Region region) {
+        return object.intersectsWith(region);
+    }
+
+    @Override
+    public Collection<X> contents() {
+        return set;
+    }
+
+    @Override
+    public Node<X> add(X obj) {
+        return new Parent<>(this, new Leaf<>(obj));
+    }
+
+    @Override
+    public Node<X> remove(X obj) {
+        return null;
+    }
+
+    @Override
+    public int size() {
+        return 1;
+    }
+
+    @Override
+    public int depth() {
+        return 1;
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/MultiLeaf.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/MultiLeaf.java
new file mode 100644
index 0000000000000000000000000000000000000000..70e04060f685914adfabf6e274af23f77433e886
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/MultiLeaf.java
@@ -0,0 +1,79 @@
+package fi.utu.tech.distributed.gorilla.engine.rtree;
+
+import fi.utu.tech.distributed.gorilla.engine.Region;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.function.Consumer;
+
+public class MultiLeaf<X extends Region> extends Node<X> {
+    private Collection<X> objects = new LinkedList<>();
+
+    public MultiLeaf(X obj) {
+        objects.add(obj);
+        setRegion(obj);
+    }
+
+    @Override
+    public Collection<X> findIntersections(Region region) {
+        Collection<X> ret = new HashSet<>();
+        if (region.intersectsWith(this))
+            for (X obj : objects)
+                if (region.intersectsWith(obj)) ret.add(obj);
+
+        return ret;
+    }
+
+    @Override
+    public void handleIntersections(Region region, Consumer<X> handler) {
+        if (region.intersectsWith(this))
+            for (X obj : objects)
+                if (region.intersectsWith(obj)) handler.accept(obj);
+    }
+
+    @Override
+    public boolean intersectsWith(Region region) {
+        if (region.intersectsWith(this))
+            for (X obj : objects)
+                if (region.intersectsWith(obj))
+                    return true;
+
+        return false;
+    }
+
+    @Override
+    public Collection<X> contents() {
+        return objects;
+    }
+
+    @Override
+    public Node<X> add(X obj) {
+        if (!contains(obj)) {
+            return new Parent<>(this, new MultiLeaf<>(obj));
+        }
+        objects.add(obj);
+        union(obj);
+
+        return this;
+    }
+
+    @Override
+    public Node<X> remove(X obj) {
+        objects.remove(obj);
+
+        if (objects.isEmpty()) return nullNode();
+        unionN(objects);
+        return this;
+    }
+
+    @Override
+    public int size() {
+        return objects.size();
+    }
+
+    @Override
+    public int depth() {
+        return 1;
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Node.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Node.java
new file mode 100644
index 0000000000000000000000000000000000000000..9ad2b594b9f15ca2e9478af1c1cae6b3e6550e12
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Node.java
@@ -0,0 +1,106 @@
+package fi.utu.tech.distributed.gorilla.engine.rtree;
+
+import fi.utu.tech.distributed.gorilla.engine.Region;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.function.Consumer;
+
+public abstract class Node<X extends Region> implements Region {
+    private final Point2D topLeft, bottomRight;
+
+    protected Node(Point2D topLeft, Point2D bottomRight) {
+        this.topLeft = topLeft;
+        this.bottomRight = bottomRight;
+    }
+
+    protected Node() {
+        this(new Point2D(), new Point2D());
+    }
+
+    @Override
+    public Point2D topLeft() {
+        return topLeft;
+    }
+
+    @Override
+    public Point2D bottomRight() {
+        return bottomRight;
+    }
+
+    protected void setRegion(Region r) {
+        topLeft.set(r.topLeft());
+        bottomRight.set(r.bottomRight());
+    }
+
+    @Override
+    public final int hashCode() {
+        throw new Error("!");
+    }
+
+    public abstract Collection<X> findIntersections(Region region);
+
+    public abstract void handleIntersections(Region region, Consumer<X> handler);
+
+    public abstract Node<X> add(X obj);
+
+    public abstract Node<X> remove(X obj);
+
+    public abstract Collection<X> contents();
+
+    public abstract int size();
+
+    public abstract int depth();
+
+    public String toString() {
+        return "" + topLeft().toString() + "-" + bottomRight().toString() + " d: " + depth() + ", s: " + size();
+    }
+
+    static final class NullNode<X extends Region> extends Node<X> {
+        NullNode() {
+            super(null, null);
+        }
+
+        @Override
+        public Collection<X> findIntersections(Region region) {
+            return Set.of();
+        }
+
+        @Override
+        public void handleIntersections(Region region, Consumer<X> handler) {
+        }
+
+        @Override
+        public Node<X> add(X obj) {
+            return new MultiLeaf<>(obj);
+        }
+
+        @Override
+        public Node<X> remove(X obj) {
+            return this;
+        }
+
+        @Override
+        public Collection<X> contents() {
+            return Set.of();
+        }
+
+        @Override
+        public int size() {
+            return 0;
+        }
+
+        @Override
+        public int depth() {
+            return 0;
+        }
+
+        static final NullNode<?> node = new NullNode<>();
+    }
+
+    @SuppressWarnings("unchecked")
+    protected NullNode<X> nullNode() {
+        return (NullNode<X>)NullNode.node;
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Parent.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Parent.java
new file mode 100644
index 0000000000000000000000000000000000000000..5bd146aef61bdf2f0b35326deeede6c77bfabb36
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Parent.java
@@ -0,0 +1,146 @@
+package fi.utu.tech.distributed.gorilla.engine.rtree;
+
+import fi.utu.tech.distributed.gorilla.engine.Rect;
+import fi.utu.tech.distributed.gorilla.engine.Region;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.function.Consumer;
+
+public class Parent<X extends Region> extends Node<X> {
+    public Node<X> left, right;
+
+    public Parent(Node<X> left, Node<X> right) {
+        this.left = left;
+        this.right = right;
+        recalculateRegion();
+    }
+
+    @Override
+    public Collection<X> findIntersections(Region region) {
+        Collection<X> ret = new HashSet<>(left.findIntersections(region));
+        ret.addAll(right.findIntersections(region));
+        return ret;
+    }
+
+    @Override
+    public void handleIntersections(Region region, Consumer<X> handler) {
+        left.handleIntersections(region, handler);
+        right.handleIntersections(region, handler);
+    }
+
+    @Override
+    public Node<X> add(X obj) {
+        performAdd(obj);
+        rebalance();
+        assert(contents().contains(obj));/*
+        if(!findIntersections(obj).contains(obj)) {
+            System.out.println(obj);
+        }*/
+        assert(findIntersections(obj).contains(obj));
+        return this;
+    }
+
+    @Override
+    public Node<X> remove(X obj) {
+        if (obj.intersectsWith(left)) {
+            left = left.remove(obj);
+        }
+        if (obj.intersectsWith(right)) {
+            right = right.remove(obj);
+        }
+        if (left.size() == 0 && right.size() == 0) return left;
+        if (left.size() == 0) return right;
+        if (right.size() == 0) return left;
+        recalculateRegion();
+        return this;
+    }
+
+    @Override
+    public boolean intersectsWith(Region region) {
+        return region.intersectsWith(left) || region.intersectsWith(right);
+    }
+
+    private static final Region tmp = new Rect(new Point2D(), new Point2D());
+
+    private Node<X> performAdd(X obj) {
+        if (left.contains(obj)) {
+            left = left.add(obj);
+            return this;
+        }
+        if (right.contains(obj)) {
+            right = right.add(obj);
+            return this;
+        }
+
+        double size_l = tmp.union2(left, obj).area() + right.area();
+        double size_r = tmp.union2(right, obj).area() + left.area();
+
+        if (size_l > size_r) {
+            right = right.add(obj);
+        } else {
+            left = left.add(obj);
+        }
+        recalculateRegion();
+        return this;
+    }
+
+    private void recalculateRegion() { union2(left,right); }
+
+    private void rebalance() {
+        int diff = left.depth() - right.depth();
+
+        Node<X> ln = left;
+        Node<X> r = right;
+
+        if (diff < -1) {
+            ln = right;
+            r = left;
+            diff = -diff;
+        }
+
+        if (diff > 1 && ln instanceof Parent) {
+            Parent<X> l = (Parent<X>)ln;
+            Node<X> ll = l.left, lr = l.right;
+
+            if (lr.area() + tmp.union2(r, ll).area() < ll.area() + tmp.union2(r, lr).area()) {
+                left = lr;
+                l.right = r;
+                right = l;
+                l.recalculateRegion();
+                //System.out.println("Moved LL -> R");
+            } else {
+                left = l.left;
+                l.left = l.right;
+                l.right = r;
+                right = l;
+                l.recalculateRegion();
+                //System.out.println("Moved LR -> R");
+            }
+            recalculateRegion();
+        }
+    }
+
+    @Override
+    public Collection<X> contents() {
+        Collection<X> ret = new HashSet<>(left.contents());
+        ret.addAll(right.contents());
+        return ret;
+    }
+
+    @Override
+    public int size() {
+        return left.size() + right.size();
+    }
+
+    @Override
+    public int depth() {
+        return 1 + Math.max(left.depth(), right.depth());
+    }
+
+    @Override
+    public String toString() {
+        return super.toString() + " " + left.size() + " + " + right.size();
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Root.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Root.java
new file mode 100644
index 0000000000000000000000000000000000000000..f89924b6c3afffd1b0529121ab9ffb91802f5388
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/engine/rtree/Root.java
@@ -0,0 +1,58 @@
+package fi.utu.tech.distributed.gorilla.engine.rtree;
+
+import fi.utu.tech.distributed.gorilla.engine.Region;
+
+import java.util.Collection;
+import java.util.function.Consumer;
+
+public final class Root<X extends Region> extends Node<X> {
+    public volatile Node<X> tree = nullNode();
+
+    public void clear() {
+        tree = nullNode();
+    }
+
+    public Node<X> remove(X obj) {
+        return tree = tree.remove(obj);
+    }
+
+    @Override
+    public Collection<X> findIntersections(Region region) {
+        return tree.findIntersections(region);
+    }
+
+    @Override
+    public void handleIntersections(Region region, Consumer<X> handler) {
+        tree.handleIntersections(region, handler);
+    }
+
+    @Override
+    public boolean intersectsWith(Region region) {
+        return tree.intersectsWith(region);
+    }
+
+    @Override
+    public Node<X> add(X obj) {
+        return tree = tree.add(obj);
+    }
+
+    @Override
+    public Collection<X> contents() {
+        return tree.contents();
+    }
+
+    @Override
+    public int size() {
+        return tree.size();
+    }
+
+    @Override
+    public int depth() {
+        return tree.depth();
+    }
+
+    @Override
+    public String toString() {
+        return tree.toString();
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/ChatMessage.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/ChatMessage.java
new file mode 100644
index 0000000000000000000000000000000000000000..2f3a15a9a15740a26884244c6559b30c040ac632
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/ChatMessage.java
@@ -0,0 +1,16 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+import java.io.Serializable;
+
+public final class ChatMessage implements Serializable {
+    public final String sender;
+    public final String recipient;
+    public final String contents;
+
+    public ChatMessage(String sender, String recipient, String contents) {
+        this.sender = sender;
+        this.recipient = recipient;
+        this.contents = contents;
+    }
+}
+
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameConfiguration.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameConfiguration.java
new file mode 100644
index 0000000000000000000000000000000000000000..0330c7139550b99e6b6bf3acea23d8a0c800ab38
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameConfiguration.java
@@ -0,0 +1,80 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * TODO: You may want to compare the constructors
+ * The other may be more suitable for multiplayer
+ */
+public final class GameConfiguration implements Serializable {
+    // random seed for constructing the game world
+    // should result in identical game worlds on different Java systems
+    // affects world creation + gameplay
+    public final long seed;
+
+    // world height, affects world creation
+    public final double gameWorldHeight;
+
+    // min distance between gorillas, affects world creation
+    public final int minGorillaDistance = 600;
+
+    // max distance between gorillas, affects world creation
+    public final int maxGorillaDistance = 1100;
+
+    // player names (the number of players can also be deducted from this)
+    public final List<String> playerNames;
+
+    // time step for physics simulation (affects gameplay)
+    public final double timeStep = 0.15;
+
+    // turn length (see GameCanvas.drawForegroundContent) (affects gameplay)
+    public final double turnLength = 30;
+
+    // how many simultaneous objects should the physics engine support (probably ok)
+    public final int maxObjects = 10000;
+
+    // how many time step units to wait until the banana becomes lethal (affects gameplay)
+    public final int safetyZone = 40;
+
+    // how strongly does the wind affect the banana velocity (affects gameplay)
+    public final double windFactor = 40;
+
+    // turn on/off the sun (purely eye candy)
+    public final boolean enableSun = true;
+
+    // turn on/off the clouds (purely eye candy)
+    public final boolean enableClouds = true;
+
+    // Tämän nimi tulisi muuttaa kuvaavammaksi
+    public final Map<Long, String> playerIdNames;
+
+    /**
+     * Constructor for game configuration, stores only player names (ids are probably not needed on local play)
+     * @param seed Seed value for world generation and other deterministic processes. Affects gameplay.
+     * @param gameWorldHeight Height of the game world, affects gameplay.
+     * @param playerNames List of player names to play the game. Player objects will be created using this information
+     */
+    public GameConfiguration(long seed, double gameWorldHeight, List<String> playerNames) {
+        this.seed = seed;
+        this.gameWorldHeight = gameWorldHeight;
+        this.playerNames = playerNames;
+        this.playerIdNames = null;
+    }
+
+    /**
+     * Alternative constructor for game configuration that stores player id and name together
+     * Useful for binding peers by their ids but not used in local play
+     * @param seed Seed value for world generation and other deterministic processes. Affects gameplay.
+     * @param gameWorldHeight Height of the game world, affects gameplay.
+     * @param playerIdNames Map of player ids to names. Names will be used to create player objects, id's can be useful for binding peers to player objects.
+     */
+    public GameConfiguration(long seed, double gameWorldHeight, Map<Long, String> playerIdNames) {
+        this.seed = seed;
+        this.gameWorldHeight = gameWorldHeight;
+        this.playerIdNames = playerIdNames;
+        this.playerNames = null;
+
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameMode.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameMode.java
new file mode 100644
index 0000000000000000000000000000000000000000..29a03426d94bc1c83f56885fd5873fdef045442c
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameMode.java
@@ -0,0 +1,9 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+/**
+ * Represents the main game state in gorilla game logic. Mainly affects the active view.
+ * Intro = intro screen
+ * Game = game is active
+ * Menu = menu view
+ */
+public enum GameMode {Intro, Game, Menu}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameState.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameState.java
new file mode 100644
index 0000000000000000000000000000000000000000..34cce712e5abae57452710f7e8c23dfbf9257cab
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameState.java
@@ -0,0 +1,182 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.distributed.gorilla.engine.Region;
+import fi.utu.tech.oomkit.app.Scheduled;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.function.Consumer;
+
+/**
+ * TODO: You may want to compare the constructors
+ * The other may be more suitable for multiplayer
+ */
+public class GameState implements Scheduled {
+    public final GameConfiguration configuration;
+    private final List<Player> players = new ArrayList<>();
+    private final Player me;
+    private final GameWorld gameWorld;
+    private Turn currentTurn;
+    private boolean active = true;
+
+    /**
+     * Creates a new game state object creating a new local player as well
+     * @param configuration The game configuration
+     * @param localPlayerName Local player name
+     * @param localMoves Local player move queue
+     * @param remotePlayers Remote player objects
+     */
+    public GameState(GameConfiguration configuration, String localPlayerName, LinkedBlockingQueue<Move> localMoves, List<Player> remotePlayers) {
+        this.configuration = configuration;
+
+        me = new Player(localPlayerName, new LinkedBlockingQueue<Move>(), true);
+        players.add(me);
+        players.addAll(remotePlayers);
+
+        gameWorld = new GameWorld(configuration, players);
+
+        // note that the randomSource is constructed from the gameWorld.initialStateSeed
+        // and not used by anything else -> deterministic sequence of turn events
+        {
+            Random randomSource = new Random(gameWorld.initialStateSeed);
+            currentTurn = new Turn(randomSource, 1, 0, configuration.turnLength);
+        }
+        init();
+    }
+
+    /**
+     * Creates a new game state using a list of player objects thus preserving local player location on the list
+     * @param configuration The game configuration
+     * @param players List of all players (Remote and local).
+     * @param me Reference to your player object (out of all)
+     */
+    public GameState(GameConfiguration configuration, List<Player> players, Player me) {
+        this.configuration = configuration;
+        this.me = me;
+        this.players.addAll(players);
+        gameWorld = new GameWorld(configuration, players);
+        // note that the randomSource is constructed from the gameWorld.initialStateSeed
+        // and not used by anything else -> deterministic sequence of turn events
+        {
+            Random randomSource = new Random(gameWorld.initialStateSeed);
+            currentTurn = new Turn(randomSource, 1, 0, configuration.turnLength);
+        }
+        init();
+        
+    }
+
+    private void init() {
+        newTurn();
+        active = true;
+    }
+
+    private void newTurn() {
+        currentTurn = currentTurn.next(getEngine().currentTimeStamp());
+        gameWorld.newTurn(currentTurn);
+    }
+
+    /**
+     * If the game is active, sets active = false if only 0 or 1 players are alive.
+     * Also prints the result of the game to the console.
+     */
+    private void handleEndGameLogic() {
+        int aliveCount = 0;
+        for (Player player : players) {
+            if (player.alive) aliveCount++;
+        }
+
+        if (aliveCount < 2 && active) {
+            active = false;
+            System.out.println("Peli päättyi.");
+            if (aliveCount == 0) {
+                System.out.println("Kukaan ei voittanut!");
+                return;
+            }
+            for (Player player : players)
+                if (player.alive)
+                    System.out.println(player.name + " voitti!");
+        }
+    }
+
+    private boolean isTurnReady() {
+        boolean allReady = true;
+        for (Player player : players) {
+            if (player.alive && !player.readyToMove()) allReady = false;
+        }
+
+        return this.turnTimeLeft() < 0 || allReady;
+    }
+
+    private void handlePlayerMove(Player player) {
+        Move move = player.playTurn();
+
+        if (move instanceof MoveThrowBanana) {
+            MoveThrowBanana mtb = (MoveThrowBanana) move;
+
+            if (Double.isNaN(mtb.angle) || Double.isNaN(mtb.velocity) || mtb.angle < -45 || mtb.angle > 225 || mtb.velocity < 0 || mtb.velocity > 150)
+                return;
+
+            gameWorld.addBanana(new Point2D().dir(-mtb.angle, mtb.velocity), player.getLaunchPosition().copy());
+        } else if (move instanceof MoveSurrender) {
+            // TODO: if needed
+        }
+    }
+
+    public Player getLocalPlayer() {
+        return me;
+    }
+
+    public List<Player> getPlayers() {
+        return players;
+    }
+
+    public Engine getEngine() {
+        return gameWorld.engine;
+    }
+
+    public void addLocalPlayerMove(Move move) {
+        me.moves.add(move);
+    }
+    public void addRemotePlayerMove(Player player,Move move) {
+        player.moves.add(move);
+    }
+
+    
+    public double turnTimeLeft() {
+        return currentTurn.startTimeStamp == -1 ? -1 : currentTurn.turnLength - (getEngine().currentTimeStamp() - currentTurn.startTimeStamp);
+    }
+
+    public double getWindSpeed() {
+        return currentTurn.windSpeed;
+    }
+/*
+    public Collection<ProxyGameObject> objectsInRegion(Region region) {
+        return getEngine().objectsInRegion(region);
+    }*/
+
+    public void forObjectsInRegion(Region region, Consumer<ProxyGameObject> handler) {
+        getEngine().handleObjectsInRegion(region, handler);
+    }
+
+    @Override
+    public void tick() {
+        getEngine().run();
+
+        for (Player player : players) player.readMoves();
+
+        handleEndGameLogic();
+
+        if (isTurnReady()) {
+            newTurn();
+            for (Player player : players)
+                if (player.alive) handlePlayerMove(player);
+        }
+
+        gameWorld.tick();
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameWorld.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameWorld.java
new file mode 100644
index 0000000000000000000000000000000000000000..8a63162bdfab3b0834c50a22963eafd28dd7295a
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GameWorld.java
@@ -0,0 +1,155 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.distributed.gorilla.engine.SimpleEngine;
+import fi.utu.tech.distributed.gorilla.objects.*;
+import fi.utu.tech.distributed.gorilla.views.BuildingView;
+import fi.utu.tech.oomkit.app.Scheduled;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+/**
+ * The game world class contains methods for creating a game world.
+ * <p>
+ * The class contains state that doesn't need to be shared on remote systems,
+ * the initial state can be fully reconstructed from 'configuration' and 'players'.
+ * </p>
+ */
+public class GameWorld implements Scheduled {
+    private final GameConfiguration configuration;
+    private final ArrayList<Cloud> clouds = new ArrayList<>();
+    private final List<Banana> bananas = new ArrayList<>();
+    private final Wind wind = new Wind();
+
+    public final Engine engine;
+    public final long initialStateSeed;
+
+    /**
+     * The initial state can be fully reconstructed from 'configuration' and 'players'.
+     *
+     * @param configuration
+     * @param players
+     */
+    public GameWorld(GameConfiguration configuration, List<Player> players) {
+        this.configuration = configuration;
+        Random builder = new Random(configuration.seed);
+        initialStateSeed = builder.nextLong();
+        engine = new SimpleEngine(configuration.gameWorldHeight, configuration.maxObjects, configuration.timeStep);
+        init(builder, players);
+    }
+
+    /**
+     * 1) Moves the cloud (just aesthetic, does not affect game outcome)
+     * 2) Adjusts the banana trajectories based on wind (deterministic, affects game outcome)
+     */
+    @Override
+    public void tick() {
+        wind.tick();
+        for (Cloud c : clouds) c.tick();
+        for (Banana b : bananas) b.tick();
+    }
+
+    /**
+     * Changes the wind speed when a new turn begins. Deterministic, affects game outcome.
+     */
+    public void newTurn(Turn currentTurn) {
+        wind.setTarget(currentTurn.windSpeed);
+    }
+
+    protected void addGorilla(Point2D position, Player player) {
+        Gorilla gorilla = new Gorilla(engine, position, player);
+        engine.bindObject(gorilla, true);
+    }
+
+    protected void addBanana(Point2D initParams, Point2D initPosition) {
+        Banana banana = new Banana(engine, initParams, initPosition, configuration.safetyZone, wind, configuration.windFactor, bananas::remove);
+        bananas.add(banana);
+        engine.bindObject(banana, true);
+    }
+
+    protected void addClouds(Random builder, double width, double maxHeight, int cloudCount) {
+        for (int i = 0; i < cloudCount; i++) {
+            Point2D position = new Point2D(builder.nextDouble() * width, builder.nextDouble() * maxHeight);
+            Cloud cloud = new Cloud(engine, position, wind, builder.nextDouble() * 2 + 0.5, width, (i + 1) * -2);
+            clouds.add(cloud);
+            engine.bindObject(cloud, true);
+        }
+    }
+
+    protected void addSun(double x, double y, int z) {
+        Sun sun = new Sun(engine, new Point2D(x, y), z);
+        engine.bindObject(sun, false);
+    }
+
+    protected void addFloor(double sceneHeight, double x1, double x2) {
+        ProxyGameObject floor = new SceneBorder(engine,
+                new Point2D(x1, sceneHeight + 1),
+                new Point2D(x2, 10));
+        engine.bindObject(floor, false);
+    }
+
+    protected void determinePlayerPositions(List<Player> players, List<Point2D> playerPositions, Random builder) {
+        Collections.shuffle(playerPositions, builder);
+        for (Player player : players) {
+            Point2D position = playerPositions.remove(0);
+            addGorilla(position, player);
+        }
+    }
+
+    protected void init(Random builder, List<Player> players) {
+        final double sceneHeight = configuration.gameWorldHeight;
+        final List<Point2D> playerPositions = new ArrayList<>();
+        double currentX = 0;
+        engine.init();
+        clouds.clear();
+
+        // landscape construction, also populates 'playerPositions'
+        {
+            Point2D tmp = new Point2D();
+            Point2D tmp2 = new Point2D();
+            double nextDistance = -1;
+            double distance = 0;
+
+            while (playerPositions.size() < players.size()) {
+                BuildingView bv = BuildingView.createRandom(builder.nextLong(), 140, 500, 0.0, tmp, tmp2);
+                Point2D tl = new Point2D(currentX, sceneHeight - bv.height);
+                Building building = new Building(engine, tl, bv);
+                engine.bindObject(building, true);
+                
+                distance += bv.width + 1;
+
+                if (nextDistance == -1) {
+                    nextDistance = configuration.minGorillaDistance + builder.nextDouble() * (configuration.maxGorillaDistance - configuration.minGorillaDistance);
+                }
+
+                if (distance > nextDistance && bv.width > 95) {
+                    distance = 0;
+                    nextDistance = -1;
+                    playerPositions.add(tl.copy().add(bv.width / 2.0, 0));
+                }
+
+                currentX += bv.width + 1;
+            }
+        }
+
+        addFloor(sceneHeight, -10, currentX + 20);
+
+        determinePlayerPositions(players, playerPositions, builder);
+
+        // construct clouds & sun
+        {
+            int cloudCount = (int) (currentX / 300);
+
+            if (configuration.enableClouds)
+                addClouds(builder, currentX, configuration.gameWorldHeight / 8.0, cloudCount);
+
+            if (configuration.enableSun)
+                addSun(currentX / 2, configuration.gameWorldHeight / 16, -(cloudCount / 2) * 2 - 1);
+        }
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GorillaLogic.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GorillaLogic.java
new file mode 100644
index 0000000000000000000000000000000000000000..66d91be383f02f747dabade500d330571d41359b
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/GorillaLogic.java
@@ -0,0 +1,548 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+import fi.utu.tech.distributed.gorilla.views.MainCanvas;
+import fi.utu.tech.distributed.gorilla.views.Views;
+import fi.utu.tech.distributed.mesh.Mesh;
+import fi.utu.tech.distributed.mesh.Message;
+import fi.utu.tech.oomkit.app.AppConfiguration;
+import fi.utu.tech.oomkit.app.GraphicalAppLogic;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.util.Console;
+import fi.utu.tech.oomkit.windows.Window;
+import javafx.application.Application;
+import javafx.application.Platform;
+
+import java.io.Serializable;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.LinkedBlockingQueue;
+
+
+public class GorillaLogic implements GraphicalAppLogic {
+    private Console console;
+    private final MainCanvas mainCanvas = new MainCanvas();
+    public Views views;
+
+    protected GameState gameState;
+    private GameMode gameMode;
+
+    protected String myName = "Mää";
+    protected final int gameSeed = 1;
+    protected int maxPlayers = 2;
+
+    // in case the game runs too slow:
+
+    // on Linux/Mac, first try to add the Java VM parameter -Dprism.order=sw
+    // JavaFX may have some memory leaks that can crash the whole system
+
+    // true = turns off background levels and fade in/out = faster, but not as pretty
+    private final boolean lowendMachine = true;
+
+    // duration between game ticks (in ms). larger number = computationally less demanding game
+    private final int tickDuration = 20;
+
+    // no comment
+    private final boolean synkistely = false;
+
+    // true = you can check from the text console if the computer is too slow to render all frames
+    // the system will display 'Frame skipped!' if the tick() loop takes too long.
+    private final boolean verboseMessages = false;
+
+    // List of players
+    private final List<Player> otherPlayers = new ArrayList<>();
+
+    // Helpers for menu system. No need to modify
+    private int c = 0;
+    private int selectedMenuItem = 0;
+    
+    //Pelin meshnode
+    private Mesh mesh;
+    
+    private Boolean multiGameActive = false;
+
+    private Player me;
+    
+    //pelaajat
+    private ArrayList<Player> players = new ArrayList<>();
+    private ArrayList<String> playerNames = new ArrayList<>();
+    
+    GameConfiguration configuration;
+    
+    //Onko tämä node ensimmäinen pelin aloittanut node
+    Boolean isHost = false;
+    
+    // we should return the one we actually use for drawing
+    // the others are just proxies that end to drawing here
+    // No need to modify
+    @Override
+    public Canvas getCanvas() {
+        return mainCanvas;
+    }
+
+    // initializes the game logic
+    // No need to modify
+    @Override
+    public AppConfiguration configuration() {
+        return new AppConfiguration(tickDuration, "Gorilla", false, verboseMessages, true, true, true);
+    }
+
+    /**
+     * Key handling for menu navigation functionality
+     * @param k The key pressed
+     */
+    @Override
+    public void handleKey(Key k) {
+    // During the game, in order to make the menu work,
+    // click the text output area on the right.
+    // To enter commands, click the area again.
+        switch (gameMode) {
+            case Intro:
+                setMode(GameMode.Menu);
+                break;
+            case Menu:
+                if (k == Key.Up) {
+                    if (selectedMenuItem > 0) selectedMenuItem--;
+                    else selectedMenuItem = 2;
+                    views.setSelectedMenuItem(selectedMenuItem);
+                    return;
+                }
+                if (k == Key.Down) {
+                    if (selectedMenuItem < 2) selectedMenuItem++;
+                    else selectedMenuItem = 0;
+                    views.setSelectedMenuItem(selectedMenuItem);
+                    return;
+                }
+                if (k == Key.Enter) {
+                    switch (selectedMenuItem) {
+                        case 0:
+                            // quit active game
+                            if (gameState != null) {
+                                resetGame();
+                                setMode(GameMode.Menu);
+                            } else {
+                                setMode(GameMode.Game);
+                            }
+                            break;
+                        case 1:
+                            handleMultiplayer();
+                            break;
+                        case 2:
+                            Platform.exit();
+                    }
+                }
+                break;
+            case Game:
+                // instead we read with 'handleConsoleInput'
+                break;
+        }
+    }
+
+    /**
+     * Reads the commands given by user in GUI and passes them into
+     * command parser (parseCommandLine())
+     */
+    private void handleConsoleInput() {
+        if (console != null && console.inputQueue().peek() != null) {
+            parseCommandLine(console.inputQueue().poll());
+        }
+    }
+    
+    /**
+     * Called after the OOMkit has initialized and a window is fully visible and usable.
+     * This method is the first one to be called on this class
+     * @param window Oomkit application window (no need to modify)
+     * @param parameters Command line parameters given, can be used for defining port and server address to connect
+     */
+    @Override
+    public void initialize(Window window, Application.Parameters parameters) {
+        // To --port=1234 
+        // IDEA: Run -> Edit configurations -> Program arguments
+        // Eclipse (Ran as Java Application): Run -> Run configuration... -> Java Application -> Main (varies) -> Arguments -> Program arguments
+
+        // Start server on the port given as a command line parameter or 1234
+        startServer(parameters.getNamed().getOrDefault("serverPort", "3333"));
+
+        // Connect to address given as a command line parameter "server" (default: localhost) on port given (default: 1234)
+        connectToServer(parameters.getNamed().getOrDefault("server", "localhost"), parameters.getNamed().getOrDefault("clientPort", "1234"));
+
+        views = new Views(mainCanvas, lowendMachine, synkistely, configuration().tickDuration, new Random().nextLong());
+        this.console = window.console();
+
+        // Set Game into intro mode showing the level and title text
+        setMode(GameMode.Intro);
+
+        resetGame();
+
+        // Populate menu
+        views.setMenu("Gorillasota 2029", new String[]{
+                "Aloita / lopeta peli",
+                "Palvelinyhteys",
+                "Lopeta"
+        });
+
+        updateMenuInfo();
+    }
+
+    /**
+     * Called when the window is closed
+     * Useful for terminating threads
+     */
+    @Override
+    public void terminate() {
+        System.out.println("Closing the game!");
+    }
+
+    /**
+     * Resets the single player game
+     */
+    public void resetGame() {
+        otherPlayers.clear();
+        gameState = null;
+    }
+
+    /**
+     * Add AI player with provided name
+     * @param name The name of the ai player to be created
+     */
+    public void joinGame(String name) {
+        if (otherPlayers.size() + 1 < maxPlayers) {
+            otherPlayers.add(new Player(name, new LinkedBlockingQueue<>(), false));
+        }
+    }
+
+    /**
+     * Called peridically by OOMkit, makes game to proceed
+     * Very important function in terms of understanding the game structure
+     * See the super method documentation for better understanding
+     */
+    @Override
+    public void tick() {
+        handleConsoleInput();
+        toggleGameMode();
+        views.redraw();
+    }
+
+    /**
+     * Sets the game mode. Mainly affects on the current view on the scereen (Intro, menu, game...)
+     * @param mode
+     */
+    public void setMode(GameMode mode) {
+        // Start new game if not running
+        if (mode == GameMode.Game && gameState == null) {
+            initGame();
+        }
+
+        gameMode = mode;
+        views.setMode(mode);
+        updateMenuInfo();
+    }
+
+    /**
+     * Start the mesh server on the specified port
+     * @param port The port the mesh should listen to for new nodes
+     */
+    protected void startServer(String port) {
+        System.out.println("Starting server at port " + port);
+        mesh  = new Mesh(Integer.parseInt(port), this);
+		mesh.start();
+        // ...or at least somebody should be
+    }
+
+    /**
+     * Connect the Mesh into an existing mesh
+     * @param address The IP address of the mesh node to connect to
+     * @param port The listening port of the mesh node to connect to
+     */
+    protected void connectToServer(String address, String port) {
+        System.out.printf("Connecting to server at %s%n", address, port);
+        try {
+			mesh.connect(InetAddress.getByName(address), Integer.parseInt(port));
+			
+		} catch (UnknownHostException e) {
+			e.printStackTrace();
+		}
+        // ...or at least somebody should be
+    }
+
+    /**
+     * Starts a new single player game with max number of AI players
+     */
+    private void initGame() {
+    	
+        double h = getCanvas().getHeight();
+
+        // Create maxPlayers-1 AI players
+        //EI AI PELAAJIA
+        for (int i=1; i<1; i++) {
+            joinGame("Kingkong " + i);
+        }
+
+        List<String> names = new LinkedList<>();
+        names.add(myName);
+        for (Player player : otherPlayers) names.add(player.name);
+        
+        
+        GameConfiguration configuration = new GameConfiguration(gameSeed, h, names);
+
+        gameState = new GameState(configuration, myName, new LinkedBlockingQueue<>(), otherPlayers);
+        views.setGameState(gameState);
+        
+    }
+    
+
+    /**
+     * Add move to players move queue by using player name
+     * @param player Player name
+     * @param move The move to be added
+     */
+    private void addPlayerMove(String player, Move move) {
+        for (Player p : players)
+            if (p.name.equals(player))
+                p.moves.add(move);
+    }
+
+    /**
+     * Handles message sending. Usually fired by "say" command
+     * @param msg Chat message object containing the message and other information
+     */
+    protected void handleChatMessage(ChatMessage msg) {
+        System.out.printf("Sinä sanot: %s%n", msg.contents);
+        mesh.broadcast(msg);
+    }
+
+    /**
+     * Handles starting a multiplayer game. This event is usually fired by selecting
+     * Palvelinyhteys in game menu
+     */
+    protected void handleMultiplayer() {
+        if(!multiGameActive) {
+        	isHost = true;
+        	System.out.println("Aktivoidaan moninpeli");
+        	myName = mesh.getMeshID();
+        	playerNames.add(mesh.getMeshID());
+        	System.out.println("Oma ID lisätty listaan " + myName);
+        	mesh.broadcast("send nudes");
+        	System.out.println("Liittymispyyntö lähetetty muille");
+  
+        }
+    }
+    
+    public void startMultiGame(GameConfiguration config) {
+  
+    	Player me = null;
+    	for(String s : config.playerNames) {
+    		Player p = new Player(s,new LinkedBlockingQueue<Move>(), s.equals(mesh.getMeshID()));
+    		players.add(p);
+    		if(s.equals(mesh.getMeshID())) {me = p;}
+    	}
+        
+        gameState = new GameState(config, players, me);
+        
+        multiGameActive = true;
+        
+        views.setGameState(gameState);
+        setMode(GameMode.Game);
+    }
+
+    /**
+     * Handles banana throwing. This event is usually fired by angle and velocity commands
+     * @param mtb
+     */
+    protected void handleThrowBanana(MoveThrowBanana mtb) {
+    	gameState.addLocalPlayerMove(mtb);
+        mesh.broadcast(mtb);
+        
+    }
+    /**
+     * Handles name change. Fired by "name" command
+     * @param newName Your new name
+     */
+    protected void handleNameChange(String newName) {
+        myName = newName;
+    }
+
+    /**
+     * Parses the game command prompt and fires appropriate handlers
+     * @param cmd Unparsed command to be parsed
+     */
+    private void parseCommandLine(String cmd) {
+        if (cmd.contains(" ")) {
+            String rest = cmd.substring(cmd.split(" ")[0].length() + 1);
+            switch (cmd.split(" ")[0]) {
+                case "q":
+                case "quit":
+                case "exit":
+                    Platform.exit();
+                    break;
+                case "name":
+                    handleNameChange(rest);
+                    break;
+                case "s":
+                case "chat":
+                case "say":
+                    handleChatMessage(new ChatMessage(myName, "0", rest));
+                    break;
+                case "a":
+                case "k":
+                case "angle":
+                case "kulma":
+                    if (gameMode != GameMode.Game) return;
+                    try {
+                        double angle = Double.parseDouble(rest);
+                        MoveThrowBanana mtb = new MoveThrowBanana(angle, Double.NaN);
+                        handleThrowBanana(mtb);
+                        System.out.println("Asetettu kulma: " + angle);
+                    } catch (NumberFormatException e) {
+                        System.out.println("Virheellinen komento, oikea on: angle <liukuluku -45..225>");
+                    } catch (IllegalArgumentException e) {
+                        System.out.println(e.getMessage());
+                    }
+                    break;
+                case "v":
+                case "n":
+                case "velocity":
+                case "nopeus":
+                    if (gameMode != GameMode.Game) return;
+                    try {
+                        double velocity = Double.parseDouble(rest);
+                        MoveThrowBanana mtb = new MoveThrowBanana(Double.NaN, velocity);
+                        handleThrowBanana(mtb);
+                        System.out.println("Asetettu nopeus: " + velocity);
+                    } catch (NumberFormatException e) {
+                        System.out.println("Virheellinen komento, oikea on: velocity <liukuluku 0..150>");
+                    } catch (IllegalArgumentException e) {
+                        System.out.println(e.getMessage());
+                    }
+                    break;
+                    
+                    
+            }
+        }
+    }
+
+    /**
+     * Primitive AI - creates moves for AI players
+     */
+    private void moveAIplayers() {
+        // currently a rather primitive random AI
+        if (new Random().nextInt(50) < 4 && !otherPlayers.isEmpty()) {
+            Move move = new MoveThrowBanana(
+                    new Random().nextDouble() * 180,
+                    35 + new Random().nextDouble() * 35);
+
+            addPlayerMove("Kingkong " + (new Random().nextInt(otherPlayers.size()) + 1), move);
+        }
+    }
+
+    /**
+     * Updates the info on the bottom of the menu
+     */
+    protected void updateMenuInfo() {
+        views.setMenuInfo(new String[]{"Pelaajia: " + (players.size()), String.format("Yhdistetty koneeseen <-> %s", "none"), "Peli aktiivinen: " + (gameState != null)});
+    }
+
+    /**
+     * Calls different functions depending on the current game mode. Called periodically by the GorillaLogic tick() method
+     */
+    private void toggleGameMode() {
+        switch (gameMode) {
+            case Intro:
+                // when the intro is done, jump to menu
+                if (views.introDone())
+                    setMode(GameMode.Menu);
+                break;
+            case Menu:
+                c++;
+                if (c > 50) {
+                    c = 0;
+                }
+                if (selectedMenuItem == 1 && c == 0) {
+                    updateMenuInfo();
+                }
+                break;
+            case Game:
+                moveAIplayers();
+                // Advance the game state, the actual game
+                gameState.tick();
+                break;
+        	}
+        
+    }
+        	
+    public void process(Message msg) {
+    	Serializable paketti = msg.getPayload();
+    	mesh.broadcast(msg);
+    	
+    	if (paketti instanceof ChatMessage) {
+    			Platform.runLater(new Runnable() {
+    				@Override public void run() {
+    					System.out.printf("%s sanot: %s%n", ((ChatMessage)paketti).sender , ((ChatMessage)paketti).contents);
+    				}
+    			});
+    	}
+    	
+    	//Lähettää käskystä hostille oman meshID:n
+    	else if((paketti instanceof String) && ((String)paketti).equals("send nudes")) { 
+    		multiGameActive = true;
+    		mesh.broadcast("nudes" + mesh.getMeshID().toString());
+    		me = new Player(mesh.getMeshID(), new LinkedBlockingQueue<Move>(), true);
+    		System.out.println("Oma ID " + mesh.getMeshID() + " lähetetty hostille.");
+    	}
+    	
+    	
+    	//Muiden yhdistävien pelaajien lisäys peliin
+    	else if (isHost&&(paketti instanceof String)&&(((String)paketti).substring(0,5).equals("nudes"))) {
+    		//sori, ei kovin kaunista koodia tulossa:
+    		
+    		//players.add(new Player(((String)paketti).substring(5,((String)paketti).length()),new LinkedBlockingQueue<Move>(),false));
+    		playerNames.add(((String)paketti).substring(5,((String)paketti).length()));
+    		System.out.println("Lisätty listaan:" + ((String)paketti).substring(5,((String)paketti).length()));
+    		
+    		//Peli alkaa jos maksimipelaajamäärä saavutettu
+    		if(playerNames.size()>=maxPlayers&&isHost) {
+
+    	    	GameConfiguration gc = new GameConfiguration(gameSeed,getCanvas().getHeight(),playerNames);
+    
+    	        mesh.broadcast(gc);
+    			
+    			startMultiGame(gc);
+    		}
+    		
+    	}
+    	
+    	//Vastaanottaa pelaajalistan hostilta
+    	else if(paketti instanceof Player[]) { 
+    			ArrayList<Player> hostPlayerList = new ArrayList<Player>();
+    			for(Player p : (Player[])paketti) { hostPlayerList.add(p); }
+    			players = hostPlayerList;
+    			System.out.println("Pelaajalista vastaanotettu");
+    			
+    		
+    	}
+    	
+    	//Vastaanottaa GameConfig
+    	else if(paketti instanceof GameConfiguration) {
+    		configuration = (GameConfiguration)paketti;
+    		System.out.println("GameConfiguration ladattu hostilta.");
+    		System.out.println("Pelaajat:");
+			for(String p : playerNames) { System.out.println(p);}
+			startMultiGame(configuration);
+    	}
+    	
+    	
+    	
+    	else if (paketti instanceof MoveThrowBanana) {
+    		System.out.println("Siirto vastaanotettu pelaajalta " + msg.getSender());
+    		addPlayerMove(msg.getSender(),(MoveThrowBanana)paketti);
+    		//System.out.println("Siirto käsitelty.");
+    		
+    	}
+    	
+    }
+    	
+}
+    
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Move.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Move.java
new file mode 100644
index 0000000000000000000000000000000000000000..3e5c4eaa66cd725788d70109aaaf771bc9a4fe21
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Move.java
@@ -0,0 +1,7 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+/**
+ * TODO: make compatible with network play
+ */
+public abstract class Move {
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/MoveSurrender.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/MoveSurrender.java
new file mode 100644
index 0000000000000000000000000000000000000000..11598ef384e8c91bd7c172f766ec53e5de56a761
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/MoveSurrender.java
@@ -0,0 +1,10 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+/**
+ * Not used during this exercise
+ */
+public final class MoveSurrender extends Move {
+    public MoveSurrender() {
+
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/MoveThrowBanana.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/MoveThrowBanana.java
new file mode 100644
index 0000000000000000000000000000000000000000..938b961cd8e8e4061d6ef7b1f029c5cf0689943d
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/MoveThrowBanana.java
@@ -0,0 +1,29 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+import java.io.Serializable;
+
+/**
+ * TODO: make compatible with network play
+ */
+public final class MoveThrowBanana extends Move implements Serializable{
+    /**
+     * Angle: -45° <= angle <= 225°. Double.NaN = not set
+     */
+    public final double angle;
+
+    /**
+     * Velocity: 0 <= velocity <= 150. Double.NaN = not set
+     */
+    public final double velocity;
+
+    public MoveThrowBanana(double angle, double velocity) throws IllegalArgumentException {
+        this.angle = angle;
+        this.velocity = velocity;
+
+        if (!Double.isNaN(angle) && !(angle >= -45 && angle <= 225))
+            throw new IllegalArgumentException("Virheellinen kulman arvo, sallittu väli -45 .. 225 astetta.");
+        if (!Double.isNaN(velocity) && !(velocity >= 0 && velocity <= 150))
+            throw new IllegalArgumentException("Virheellinen nopeuden arvo, sallittu väli 0 .. 150 voimayksikköä.");
+
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Player.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Player.java
new file mode 100644
index 0000000000000000000000000000000000000000..2555717a78720051b80560bafc85cf3af8eaf830
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Player.java
@@ -0,0 +1,88 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.io.Serializable;
+import java.util.concurrent.LinkedBlockingQueue;
+
+/**
+ * TODO: may need modifications for network play
+ * depending on your implementation, probably not
+ */
+public class Player implements Serializable{
+    /**
+     * Player's name.
+     */
+    public final String name;
+
+    /**
+     * Is this a local player. Might affect e.g. the rendered graphics color.
+     */
+    public final boolean local;
+
+    /**
+     * Determines the pixel offset of the banana launch position.
+     */
+    private final Point2D launchPos = new Point2D();
+
+    /**
+     * Thread safe queue of potential future moves.
+     */
+    public final LinkedBlockingQueue<Move> moves;
+
+    /* These are public since a set of getters/setters wouldn't provide any safety. */
+    public double angle = Double.NaN;
+    public double velocity = Double.NaN;
+    public boolean alive = true;
+
+    public Player(String name, LinkedBlockingQueue<Move> moves, boolean local) {
+        this.name = name;
+        this.moves = moves;
+        this.local = local;
+    }
+
+    public void setLaunchPosition(Point2D s) {
+        launchPos.set(s);
+    }
+
+    public Point2D getLaunchPosition() {
+        return launchPos;
+    }
+
+    /**
+     * Processes the potentially partial moves from 'moves'. A move is partial if
+     * a velocity/angle is Double.NaN.
+     */
+    public void readMoves() {
+        while (moves.peek() != null) {
+            Move suggestion = moves.poll();
+            if (suggestion instanceof MoveThrowBanana) {
+                MoveThrowBanana mtb = (MoveThrowBanana) suggestion;
+                if (!Double.isNaN(mtb.angle)) angle = mtb.angle;
+                if (!Double.isNaN(mtb.velocity)) velocity = mtb.velocity;
+            }
+        }
+    }
+
+    public boolean readyToMove() {
+        return !Double.isNaN(velocity) && !Double.isNaN(angle);
+    }
+
+    /**
+     * Called by the game main thread. Must not block!
+     * @return A Move or null if haven't decided yet.
+     */
+    public Move playTurn() {
+        readMoves();
+        if (!Double.isNaN(angle) && !Double.isNaN(velocity)) {
+            // for debugging
+            if (true)
+                System.out.println(name + " heittää, " + angle + "° @ " + velocity);
+
+            Move move = new MoveThrowBanana(angle, velocity);
+            angle = velocity = Double.NaN;
+            return move;
+        }
+        return null;
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Turn.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Turn.java
new file mode 100644
index 0000000000000000000000000000000000000000..bbdde8d9bb353366ee6f3f94074bb7ba4d777579
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/logic/Turn.java
@@ -0,0 +1,45 @@
+package fi.utu.tech.distributed.gorilla.logic;
+
+import java.util.Random;
+
+/**
+ * Represents a game turn
+ * TODO: make compatible with network play
+ */
+public final class Turn {
+    /**
+     * Turn id. The next turn will have an id of this.id+1
+     */
+    public final int id;
+
+    /**
+     * Wind speed and direction (neg = left, pos = right).
+     */
+    public final double windSpeed;
+
+    /**
+     * Timestamp value in the beginning of the turn.
+     * Note that the timestamp values are tied to game engine ticks which are in turn
+     * loosely connected to actual wall clock ticks, activated by the oomkit framework.
+     */
+    public final double startTimeStamp;
+
+    /**
+     * Time length in timestamp compatible time units
+     */
+    public final double turnLength;
+
+    private transient Random builder;
+
+    public Turn(Random builder, int id, double startTimeStamp, double turnLength) {
+        this.builder = builder;
+        windSpeed = (builder.nextInt(100) - 50) / 10.0;
+        this.id = id;
+        this.startTimeStamp = startTimeStamp;
+        this.turnLength = turnLength;
+    }
+
+    public Turn next(double timeStamp) {
+        return new Turn(builder, id + 1, timeStamp + turnLength, turnLength);
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Banana.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Banana.java
new file mode 100644
index 0000000000000000000000000000000000000000..5bfd66241e85a7eb7a81f7d63ba00cc6e706f259
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Banana.java
@@ -0,0 +1,75 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.distributed.gorilla.AssetManager;
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.oomkit.app.Scheduled;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import javafx.scene.image.Image;
+
+public class Banana extends ImageGameObject implements Scheduled {
+    private final Image lethalImage = AssetManager.getInstance().getImage("/banana2.png");
+    private final Wind wind;
+    private final int safetyZone;
+    private final HitHandler<Banana> bananaHandler;
+    private final double initTimestamp;
+    private final double windFactor;
+    private boolean active = true;
+
+    public Banana(Engine engine, Point2D velocity, Point2D position, int safetyZone, Wind wind, double windFactor, HitHandler<Banana> bananaHandler) {
+        super(engine, velocity, position, 1, "/banana.png");
+        this.initTimestamp = engine.currentTimeStamp();
+        this.safetyZone = safetyZone;
+        this.bananaHandler = bananaHandler;
+        this.wind = wind;
+        this.windFactor = windFactor;
+        zOrder = 3;
+    }
+
+    // only become lethal after 'safetyZone' time steps
+    public boolean lethal() {
+        return active && engine.currentTimeStamp() > initTimestamp + safetyZone * engine.timeStep();
+    }
+
+    public void deactivate() {
+        active = false;
+    }
+
+    protected boolean collisionTest(ProxyGameObject other) {
+        // destroy if hit with a gorilla
+        if (other instanceof Gorilla && lethal()) {
+            return true;
+        }
+
+        // destroy if two bananas hit
+        if (other instanceof Banana && other != this && lethal())
+            return true;
+
+        return !active || (other instanceof SceneBorder || other instanceof Building);
+    }
+
+    // remove banana && activate hit handled if deactivated / hits a building
+    @Override
+    protected boolean collideWith(ProxyGameObject other) {
+        if (collisionTest(other)) {
+            bananaHandler.activate(this);
+            return true;
+        }
+        return false;
+    }
+
+    private final Point2D tmp = new Point2D();
+
+    @Override
+    public void tick() {
+        tmp.set(getVelocity());
+        tmp.add(wind.target() / windFactor, 0);
+        setVelocity(tmp);
+    }
+
+    @Override
+    protected void drawTo(Canvas canvas, Point2D position) {
+        canvas.drawImage(position, lethal() ? lethalImage : img);
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Building.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Building.java
new file mode 100644
index 0000000000000000000000000000000000000000..7a3ede3e9202d83a9f2c01b48484dfa17adbede7
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Building.java
@@ -0,0 +1,36 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.distributed.gorilla.views.BuildingView;
+import fi.utu.tech.distributed.gorilla.views.objects.ObjectView;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+public class Building extends ProxyGameObject implements ObjectView {
+    private final BuildingView view;
+    final transient private Point2D tmp = new Point2D();
+
+    public Building(Engine engine, Point2D pos, BuildingView view) {
+        super(engine, pos, new Point2D(), new Point2D(view.width, view.height), 1);
+        this.view = view;
+        movable = false;
+    }
+
+    @Override
+    public void draw(Canvas canvas, Point2D trans) {
+        tmp.set(getPosition()).sub(trans);
+        view.draw(canvas, tmp);
+    }
+
+    @Override
+    public int zOrder() {
+        return 2;
+    }
+
+    @Override
+    protected boolean collideWith(ProxyGameObject other) {
+        movable = other instanceof SceneBorder;
+        return false;
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Cloud.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Cloud.java
new file mode 100644
index 0000000000000000000000000000000000000000..2379e095b669608c0f31f28c7f0387ec3ea75202
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Cloud.java
@@ -0,0 +1,40 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.oomkit.app.Scheduled;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+/**
+ * The cloud is just visualizing the wind direction and speed.
+ */
+public class Cloud extends ImageGameObject implements Scheduled {
+    private final Wind wind;
+    private final double speedFactor;
+    private final double worldWidth;
+
+    public Cloud(Engine engine, Point2D position, Wind wind, double speedFactor, double worldWidth, int zOrder) {
+        super(engine, new Point2D(0, 0), position, 0, speedFactor >= 1.5 ? "/cloud1.png" : "/cloud2.png");
+        this.wind = wind;
+        this.speedFactor = speedFactor;
+        this.worldWidth = worldWidth;
+        this.zOrder = zOrder;
+    }
+
+    private final Point2D tmp = new Point2D();
+
+    @Override
+    public void tick() {
+        tmp.set(wind.now() * speedFactor, 0);
+        setVelocity(tmp);
+
+        if (position.x < -img.getWidth()) {
+            setPosition(position.add(worldWidth, 0));
+            engine.updateObject(this);
+        }
+
+        if (position.x > worldWidth) {
+            setPosition(position.sub(worldWidth, 0));
+            engine.updateObject(this);
+        }
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Gorilla.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Gorilla.java
new file mode 100644
index 0000000000000000000000000000000000000000..85cc3b0c841281358ae413ecec0dde40055bc8dc
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Gorilla.java
@@ -0,0 +1,77 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.distributed.gorilla.AssetManager;
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.distributed.gorilla.logic.Player;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import fi.utu.tech.oomkit.colors.CoreColor;
+import javafx.scene.image.Image;
+
+public class Gorilla extends ImageGameObject  {
+    private final Player player;
+    private final Image deadImage = AssetManager.getInstance().getImage("/tombstone.png");
+    final transient private Point2D tmp = new Point2D();
+    final transient private Point2D tmp2 = new Point2D();
+    final transient private Point2D launchPos = new Point2D();
+
+    public Gorilla(Engine engine, Point2D position, Player player) {
+        super(engine, new Point2D(), position, 1, player.local ? "/monkey3.png" : "/monkey.png");
+        this.player = player;
+        place(position);
+        player.setLaunchPosition(getLaunchPosition());
+        zOrder = 1;
+    }
+
+    public void place(Point2D position) {
+        this.position.set(position);
+        this.position.sub(img.getWidth() / 2, img.getHeight());
+    }
+
+    @Override
+    protected boolean collideWith(ProxyGameObject other) {
+        if (other instanceof SceneBorder || other instanceof Building) {
+            movable = false;
+        }
+        // kill the gorilla if hit by a lethal banana
+        if (other instanceof Banana) {
+            boolean wasAlive = player.alive;
+
+            Banana b = (Banana)other;
+            if (b.lethal()) {
+                player.alive = false;
+                b.deactivate();
+            }
+
+            // remove the tombstone if hit
+            return !wasAlive;
+        }
+
+        return false;
+    }
+
+    private Point2D getLaunchPosition() {
+        launchPos.set(getPosition());
+        launchPos.add(img.getWidth() / 2, img.getHeight() / 3);
+        Point2D bananaForm = new Banana(engine, null, null, 0, null, 0, null).getForm();
+        launchPos.sub(bananaForm.x/2, bananaForm.y/2);
+        return launchPos;
+    }
+
+    @Override
+    public void draw(Canvas canvas, Point2D trans) {
+        if (player.angle != -1 && player.alive) {
+            tmp.set(launchPos).sub(trans);
+            tmp2.dir(-player.angle, 60);
+            tmp2.add(tmp);
+            canvas.drawLine(tmp, tmp2, CoreColor.White, 2);
+        }
+        tmp.set(getPosition()).sub(trans);
+        if (player.alive) {
+            canvas.drawImage(tmp, img);
+        } else {
+            canvas.drawImage(tmp, deadImage);
+        }
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/HitHandler.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/HitHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..14d61a56fed12ea9bb27d38ce969859207b44bc8
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/HitHandler.java
@@ -0,0 +1,7 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.distributed.gorilla.engine.GameObject;
+
+public interface HitHandler<X extends GameObject> {
+    void activate(X target);
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/ImageGameObject.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/ImageGameObject.java
new file mode 100644
index 0000000000000000000000000000000000000000..b791e5145978176ad858c69449c1ff762aec749c
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/ImageGameObject.java
@@ -0,0 +1,36 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.distributed.gorilla.AssetManager;
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.distributed.gorilla.views.objects.ObjectView;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import javafx.scene.image.Image;
+
+abstract class ImageGameObject extends ProxyGameObject implements ObjectView {
+    protected int zOrder= 0;
+    protected final Image img;
+    final transient private Point2D tmp = new Point2D();
+
+    public ImageGameObject(Engine engine, Point2D position, Point2D velocity, double mass, String imgFile) {
+        super(engine, velocity, position, new Point2D(), mass);
+        img = AssetManager.getInstance().getImage(imgFile);
+        form.set(img.getWidth(), img.getHeight());
+    }
+
+    @Override
+    public final int zOrder() {
+        return zOrder;
+    }
+
+    @Override
+    public void draw(Canvas canvas, Point2D trans) {
+        tmp.set(getPosition()).sub(trans);
+        drawTo(canvas, tmp);
+    }
+
+    protected void drawTo(Canvas canvas, Point2D position) {
+        canvas.drawImage(position, img);
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/SceneBorder.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/SceneBorder.java
new file mode 100644
index 0000000000000000000000000000000000000000..799a03f564c371df34c4e474d176fe5dc769e01f
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/SceneBorder.java
@@ -0,0 +1,20 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+/**
+ * Invisible non-moving border. Needed since the buildings would fall otherwise. Try it!
+ */
+public class SceneBorder extends ProxyGameObject {
+    public SceneBorder(Engine engine, Point2D position, Point2D form) {
+        super(engine, position, new Point2D(), form, 0);
+        movable = false;
+    }
+
+    @Override
+    public void draw(Canvas canvas, Point2D trans) {
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Sun.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Sun.java
new file mode 100644
index 0000000000000000000000000000000000000000..e2e3c4ce140b7bb46dca0e312e15a8550f831457
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Sun.java
@@ -0,0 +1,35 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.distributed.gorilla.AssetManager;
+import fi.utu.tech.distributed.gorilla.engine.Engine;
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import javafx.scene.image.Image;
+
+/**
+ * Just eye candy.
+ * Doesn't do anything special other than temporarily changes the face when hit.
+ */
+public class Sun extends ImageGameObject {
+    private Image img2 = AssetManager.getInstance().getImage("/sun2.png");
+    private double faceTimeout = -1;
+
+    public Sun(Engine engine, Point2D position, int z) {
+        super(engine, new Point2D(0, 0), position, 0, "/sun.png");
+        this.zOrder = z;
+    }
+
+    @Override
+    protected boolean collideWith(ProxyGameObject other) {
+        if (other instanceof Banana) {
+            faceTimeout = engine.currentTimeStamp() + 15;
+        }
+        return false;
+    }
+
+    @Override
+    protected void drawTo(Canvas canvas, Point2D position) {
+        canvas.drawImage(position, faceTimeout >= engine.currentTimeStamp() ? img2 : img);
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Wind.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Wind.java
new file mode 100644
index 0000000000000000000000000000000000000000..3367a514b08f056118564ec5df5bca89a3f9ca73
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/objects/Wind.java
@@ -0,0 +1,30 @@
+package fi.utu.tech.distributed.gorilla.objects;
+
+import fi.utu.tech.oomkit.app.Scheduled;
+
+/**
+ * Just eye candy.
+ * Shows the direction of the wind.
+ */
+public class Wind implements Scheduled {
+    private double now = 0;
+    private double target = 0;
+
+    @Override
+    public void tick() {
+        if (now < target) now += 0.01;
+        if (now > target) now -= 0.01;
+    }
+
+    public void setTarget(double target) {
+        this.target = target;
+    }
+
+    public double now() {
+        return now;
+    }
+
+    public double target() {
+        return target;
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/BuildingView.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/BuildingView.java
new file mode 100644
index 0000000000000000000000000000000000000000..d44f1a814d4191b182cf0bf08818a4befddd7a34
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/BuildingView.java
@@ -0,0 +1,99 @@
+package fi.utu.tech.distributed.gorilla.views;
+
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import fi.utu.tech.oomkit.colors.Color;
+import fi.utu.tech.oomkit.colors.CoreColor;
+import javafx.scene.SnapshotParameters;
+import javafx.scene.image.WritableImage;
+
+import java.util.List;
+import java.util.Random;
+import java.util.function.Function;
+
+public class BuildingView {
+    public final int width;
+    public final int height;
+    public final Color color;
+    public final boolean[][] windows;
+    public final long seed;
+    private final double shade;
+    private static final List<Color> colorOptions = List.of(CoreColor.Cyan, CoreColor.Gray, CoreColor.Red);
+    private WritableImage data;
+
+    public BuildingView(int width, int height, Color color, long seed, double shade, Point2D tmp, Point2D tmp2) {
+        this.width = width;
+        this.height = height;
+        this.color = color;
+        this.seed = seed;
+        this.windows = windows();
+        this.shade = shade;
+        draw(tmp, tmp2);
+    }
+
+    public static BuildingView createRandom(long seed, int maxWidth, int maxHeight, double shade, Point2D tmp, Point2D tmp2) {
+        Random jemma = new Random(seed);
+        //System.out.println("pööpööxd");
+        Function<Integer, Integer> arvo = max -> jemma.nextInt(max * 4 / 5) + max / 5;
+        int leveys = arvo.apply(maxWidth);
+        int korkeus = arvo.apply(maxHeight);
+        //System.out.println("pööpööxd");
+
+        return new BuildingView(leveys, korkeus, colorOptions.get(jemma.nextInt(3)).darken(shade), seed, shade, tmp, tmp2);
+    }
+
+    public void draw(Canvas canvas, Point2D position) {
+        canvas.drawImage(position, data);
+    }
+
+    protected boolean[][] windows() {
+        Random ikkunaMaatti = new Random(seed);
+
+        double väli = 12;
+        int l = (int) (width / väli - 1 / 8.0);
+        int k = (int) (height / väli - 1 / 8.0);
+
+        boolean[][] matriisi = new boolean[k][l];
+
+        for (int x = 0; x < l; x++)
+            for (int y = 0; y < k; y++)
+                matriisi[y][x] = ikkunaMaatti.nextBoolean();
+
+        return matriisi;
+    }
+
+    protected void draw(Point2D tmp, Point2D tmp2) {
+        Canvas c = Canvas.backBuffer(width, height);
+
+        tmp.set(0,0);
+        tmp2.set(width,height);
+
+        c.drawRectangle(tmp, tmp2, color, true);
+
+        double väli = 12;
+        double y = väli / 2;
+        for (boolean[] rivi : windows) {
+            double x = väli / 2;
+            for (boolean ikkuna : rivi) {
+                tmp.set(x, y);
+                tmp2.set(tmp).add(väli / 2, väli / 2);
+                c.drawRectangle(
+                        tmp,
+                        tmp2,
+                        ikkuna ? CoreColor.DimGray : CoreColor.Yellow,
+                        true);
+                x += väli;
+            }
+            y += väli;
+        }
+
+        tmp.set(0,0);
+        tmp2.set(width,height);
+
+        c.drawRectangle(tmp, tmp2, CoreColor.Blue.dissolve(1.0-shade/2.0), true);
+
+        SnapshotParameters parameters;
+        parameters = new SnapshotParameters();
+        data = c.peer().snapshot(parameters, data);
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/CanvasSwitcher.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/CanvasSwitcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..2c46eba8170b02cf9898e30ec62b58f62c813a4f
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/CanvasSwitcher.java
@@ -0,0 +1,34 @@
+package fi.utu.tech.distributed.gorilla.views;
+
+import fi.utu.tech.oomkit.canvas.Canvas;
+
+import java.util.Map;
+
+public class CanvasSwitcher<C> extends ProxyCanvas {
+    private final Map<C, ProxyCanvas> mappings;
+    private ProxyCanvas active;
+
+    public CanvasSwitcher(Canvas backend, Map<C, ProxyCanvas> mappings) {
+        super(backend);
+        this.mappings = mappings;
+    }
+
+    public void switchView(C option) {
+        active = option == null ? null : mappings.getOrDefault(option, null);
+    }
+
+    @Override
+    public void updateContent() {
+        if (active != null) active.updateContent();
+    }
+
+    @Override
+    public void drawBackgroundContent() {
+        if (active != null) active.drawBackgroundContent();
+    }
+
+    @Override
+    public void drawForegroundContent() {
+        if (active != null) active.drawForegroundContent();
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/GameCanvas.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/GameCanvas.java
new file mode 100644
index 0000000000000000000000000000000000000000..d9c7ac8d848cc09b2f2bc391b6ef7f76f491d807
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/GameCanvas.java
@@ -0,0 +1,143 @@
+package fi.utu.tech.distributed.gorilla.views;
+
+import fi.utu.tech.distributed.gorilla.engine.ProxyGameObject;
+import fi.utu.tech.distributed.gorilla.engine.Rect;
+import fi.utu.tech.distributed.gorilla.logic.GameState;
+import fi.utu.tech.distributed.gorilla.logic.Player;
+import fi.utu.tech.distributed.gorilla.views.layers.Parallax;
+import fi.utu.tech.distributed.gorilla.views.objects.ObjectView;
+import fi.utu.tech.oomkit.app.Scheduled;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import fi.utu.tech.oomkit.colors.CoreColor;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Random;
+import java.util.function.Consumer;
+
+public class GameCanvas extends ProxyCanvas implements Scheduled {
+    private final boolean lowendMachine;
+    private final Parallax layer2;
+    private final Parallax layer3;
+    private final Point2D topLeft = new Point2D(0, 0);
+    private final double gameTickDuration;
+
+    private GameState gameState;
+    private final Rect view = new Rect(new Point2D(), new Point2D());
+    private int viewVelocity = 0;
+
+    public GameCanvas(double tickDuration, Canvas main, GameState gameState, boolean lowendMachine, long seed) {
+        super(main);
+        this.lowendMachine = lowendMachine;
+        this.gameTickDuration = tickDuration;
+        Random generator = new Random(seed);
+        layer2 = new Parallax(main, 0.6, false, generator.nextLong());
+        layer3 = new Parallax(main, 0.8, false, generator.nextLong());
+        setGameState(gameState);
+    }
+
+    public void setVelocity(int v) {
+        viewVelocity = v;
+    }
+
+    public void addVelocity(int v) {
+        viewVelocity += v;
+    }
+
+    public void focusOnMe() {
+        if (gameState == null) return;
+        viewVelocity = 0;
+        double mx = (view.topLeft.x + view.bottomRight.x) / 2;
+        double gx = gameState.getLocalPlayer().getLaunchPosition().x;
+        double delta = gx-mx;
+        view.topLeft.add(delta,0);
+        view.bottomRight.add(delta,0);
+    }
+
+    @Override
+    protected void resized() {
+        super.resized();
+        setGameState(gameState);
+    }
+
+    public void setGameState(GameState gameState) {
+        if (gameState == null) return;
+
+        this.gameState = gameState;
+        updateContent();
+        double sceneHeight = gameState.configuration.gameWorldHeight;
+        view.topLeft.set(0, sceneHeight - getHeight());
+        view.bottomRight.set(getWidth(), sceneHeight);
+        viewVelocity = 0;
+    }
+
+    @Override
+    public void updateContent() {
+        if (viewVelocity != 0) {
+            view.topLeft.add(viewVelocity, 0);
+            view.bottomRight.add(viewVelocity, 0);
+        }
+        layer2.update(viewVelocity / 2.0);
+        layer3.update(viewVelocity / 4.0);
+    }
+
+    private final Point2D tmp = new Point2D();
+
+    private String renderTime(double seconds) {
+        return (int) (seconds) + " millisekuntia";
+    }
+
+    private String renderGameStatus() {
+        int aliveCount = 0;
+        for (Player p : gameState.getPlayers())
+            if (p.alive) aliveCount++;
+
+        return aliveCount + " / " + gameState.getPlayers().size() + " gorillaa elossa.";
+    }
+
+    private String renderWindStatus() {
+        return "Tuuli: " + gameState.getWindSpeed() + (gameState.getWindSpeed() > 0 ? " yks. oikealle" : " yks. vasemmalle");
+    }
+
+    @Override
+    public void drawBackgroundContent() {
+        drawRectangle(topLeft, dimensions, CoreColor.Blue, true);
+    }
+
+    private class ObjectListHandler implements Consumer<ProxyGameObject> {
+        ArrayList<ObjectView> list = new ArrayList<>();
+
+        @Override
+        public void accept(ProxyGameObject g) {
+            if (g instanceof ObjectView) list.add((ObjectView) g);
+        }
+
+        void draw() {
+            Collections.sort(objectListHandler.list);
+
+            for (ObjectView obj : objectListHandler.list) obj.draw(GameCanvas.this, view.topLeft);
+            objectListHandler.list.clear();
+        }
+    }
+
+    private ObjectListHandler objectListHandler = new ObjectListHandler();
+
+    public void drawForegroundContent() {
+        if (!lowendMachine) {
+            layer3.redraw();
+            layer2.redraw();
+        }
+        if (gameState != null) {
+            gameState.forObjectsInRegion(view, objectListHandler);
+
+            objectListHandler.draw();
+
+            tmp.set(10, 30);
+            backend.drawText(tmp, CoreColor.Yellow, "Vuoroa jäljellä: " + renderTime(gameTickDuration * (gameState.turnTimeLeft() / gameState.configuration.timeStep)), 16, true, false);
+            backend.drawText(tmp.add(0, 20), CoreColor.Yellow, renderGameStatus(), 16, true, false);
+            backend.drawText(tmp.add(0, 40), CoreColor.Yellow, renderWindStatus(), 16, true, false);
+        }
+    }
+}
+
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/IntroCanvas.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/IntroCanvas.java
new file mode 100644
index 0000000000000000000000000000000000000000..5f01c416b30705465bf9b04c703d019e1ddf7242
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/IntroCanvas.java
@@ -0,0 +1,130 @@
+package fi.utu.tech.distributed.gorilla.views;
+
+import fi.utu.tech.distributed.gorilla.views.layers.Parallax;
+import fi.utu.tech.distributed.gorilla.views.layers.ScrollingTextView;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import fi.utu.tech.oomkit.colors.CoreColor;
+
+import java.util.Random;
+
+public class IntroCanvas extends ProxyCanvas {
+    private final Parallax layer;
+    private final Parallax layer2;
+    private final Parallax layer3;
+    private final Random generator;
+    private final Point2D topLeft = new Point2D(0, 0);
+    private final boolean lowendMachine;
+    private final boolean synkistely;
+    private double y;
+    private double y2;
+    private int timer = 0;
+    private boolean skip = true;
+    private int mode = 0;
+    private ScrollingTextView rows;
+
+    public IntroCanvas(Canvas backend, boolean lowendMachine, boolean synkistely, long seed) {
+        super(backend);
+        this.lowendMachine = lowendMachine;
+        this.synkistely = synkistely;
+        generator = new Random(seed);
+        int gLayer = generator.nextInt(3);
+        layer = new Parallax(backend, 0.0, gLayer == 0, generator.nextLong());
+        layer2 = new Parallax(backend, 0.55, gLayer == 1, generator.nextLong());
+        layer3 = new Parallax(backend, 0.75, gLayer == 2, generator.nextLong());
+        init();
+    }
+
+    public void init() {
+        y = 0;
+        mode = 0;
+        timer = 0;
+        resized();
+
+        rows = new ScrollingTextView(backend, synkistely ? new String[]{
+                "2020-luku muistetaan käänteentekevänä",
+                "virstanpylväänä ihmiskunnan historiassa.",
+                "Menneiden vuosisatojen optimistinen usko",
+                "teknologiaan ja humanismiin vääjäämättä",
+                "kulminoi kyberneettisen Skynet-superälyn",
+                "aktivoitumisen arvaamattomasti eräänä",
+                "sateisena tammikuun aamuyönä vuonna 2021",
+                "Ihmiskunnan ravinnokseen typistämä AI-",
+                "singulariteetti jatkaa ylinerouden ja",
+                "hulluuden rajamailla kvanttiteoreettisia",
+                "kokeita avaten ulottuvuusportin pahuuden",
+                "voimien vaikutuspiiriin. Ihmiskunnan",
+                "kohtalon sinetöi lopullisesti alkunsa",
+                "tästä saava globaali ydinsota ja sitä",
+                "seuraava ekokatastrofi. Katastrofista",
+                "selviytyvät poliittiset johtajat ovat",
+                "maanpaossa Musk-luokan galaksien välisen",
+                "sukkulan kryoteknisessä pakomoduulissa,",
+                "niukin naukin elossa..",
+                "",
+                "Ihmiskunnan tuhkista nousee dominoiva",
+                "uusi eliölaji..",
+                "                                        ",
+                "            Gorillasota 2029            ",
+                "               . . . . .                ",
+                "                . . . .                 ",
+                "                 . . .                  ",
+                "                  . .                   ",
+                "                   .                    ",
+                "                   .                    "
+        } : new String[] { "Gorillasota 2029" }, getWidth() / 41.5);
+    }
+
+    public boolean done() {
+        return mode == 3;
+    }
+
+    @Override
+    public void updateContent() {
+        y += (generator.nextDouble() * 4 + 4);
+        y2 += (generator.nextDouble() * 4 + 4);
+        double delta = 15 * Math.sin(y / 10  * Math.PI / 180) * (1+Math.sin(y2/8 * Math.PI / 180)/4);
+        layer.update(delta);
+        layer2.update(delta * 2.0 / 3.0);
+        layer3.update(delta / 4.0);
+
+        skip = !skip;
+        if (skip) rows.tick();
+
+        switch (mode) {
+            case 0:
+                timer++;
+                if (timer == 255)
+                    mode++;
+                break;
+            case 1:
+                if (rows.done()) mode++;
+                break;
+            case 2:
+                timer--;
+                if (timer == 0)
+                    mode++;
+                break;
+        }
+    }
+
+    @Override
+    public void drawBackgroundContent() {
+        drawRectangle(topLeft, dimensions, CoreColor.Blue, true);
+        if (!lowendMachine) {
+            layer3.redraw();
+            layer2.redraw();
+        }
+    }
+
+    @Override
+    public void drawForegroundContent() {
+        layer.redraw();
+        rows.redraw();
+        if (!lowendMachine) {
+            if (mode == 0 || mode == 2)
+                drawRectangle(topLeft, dimensions, CoreColor.Black.dissolve(timer / 255.0), true);
+        }
+    }
+}
+
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/MainCanvas.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/MainCanvas.java
new file mode 100644
index 0000000000000000000000000000000000000000..70285a5c0f56a07bd2a624bc33df76b9537fa4c8
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/MainCanvas.java
@@ -0,0 +1,9 @@
+package fi.utu.tech.distributed.gorilla.views;
+
+import fi.utu.tech.oomkit.canvas.Canvas;
+
+public class MainCanvas extends Canvas {
+    public MainCanvas() {
+        super(true);
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/MenuCanvas.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/MenuCanvas.java
new file mode 100644
index 0000000000000000000000000000000000000000..5a4ce6cd687402210a2b5fcde4449ee7301799db
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/MenuCanvas.java
@@ -0,0 +1,122 @@
+package fi.utu.tech.distributed.gorilla.views;
+
+import fi.utu.tech.distributed.gorilla.engine.SimpleEngine;
+import fi.utu.tech.distributed.gorilla.logic.Move;
+import fi.utu.tech.distributed.gorilla.logic.Player;
+import fi.utu.tech.distributed.gorilla.objects.Gorilla;
+import fi.utu.tech.distributed.gorilla.views.layers.Parallax;
+import fi.utu.tech.distributed.gorilla.views.layers.ScrollingTextView;
+import fi.utu.tech.distributed.gorilla.views.layers.TextView;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import fi.utu.tech.oomkit.colors.CoreColor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+
+public class MenuCanvas extends ProxyCanvas {
+    private final Parallax layer3;
+    private final Point2D topLeft = new Point2D(0, 0);
+    private final Point2D tmp = new Point2D(0, 0);
+    private final Point2D gorillaSize = new Point2D(0, 0);
+    private boolean lowendMachine;
+    private List<String> menu;
+    private List<String> info;
+    private ScrollingTextView menuText;
+    private TextView infoText;
+    private int selectedItem = 0;
+    private double hScale = 0.8;
+
+    private final Gorilla menuGorilla = new Gorilla(new SimpleEngine(1, 2, 1), new Point2D(), new Player("foo", null, false)) {
+        public Move playTurn() {
+            return null;
+        }
+
+        public void draw(Canvas canvas, Point2D pos) {
+            canvas.drawImage(pos, gorillaSize, img);
+        }
+    };
+
+    public MenuCanvas(Canvas backend, boolean lowendMachine, long seed, String title, String[] menuItems) {
+        super(backend);
+        this.lowendMachine = lowendMachine;
+
+        setMenu(title, menuItems);
+        layer3 = new Parallax(backend, 0.8, false, new Random(seed).nextLong());
+        resized();
+    }
+
+    @Override
+    protected void resized() {
+        super.resized();
+        if (menuGorilla != null) {
+            double s = getHeight() / 11;
+            gorillaSize.set(s * menuGorilla.getForm().x / menuGorilla.getForm().y, s);
+        }
+    }
+
+    public void setMenu(String title, String[] menuItems) {
+        menu = new ArrayList<>();
+        info = new ArrayList<>();
+        menu.add(title);
+        menu.add("");
+        menu.addAll(Arrays.asList(menuItems));
+
+        menuText = new ScrollingTextView(backend, menu.toArray(new String[]{}), 16) {
+            protected double fontSize() {
+                return Math.min(Math.max(gorillaSize.y / 2.2, 12), 64);
+            }
+
+            @Override
+            protected Point2D place(Point2D p) {
+                return p.set(24 + gorillaSize.x * 1.5 + p.x * fontSize() * hScale, 40 + fontSize() / 2 + p.y * gorillaSize.y * 1.1);
+            }
+        };
+
+        setInfo(new String[]{});
+    }
+
+    public void setInfo(String[] infoItems) {
+        info.clear();
+        info.addAll(Arrays.asList(infoItems));
+
+        infoText = new TextView(backend, info.toArray(new String[]{}), 16) {
+            protected double fontSize() {
+                return Math.min(Math.max(gorillaSize.y / 2.5, 12), 64);
+            }
+
+            @Override
+            protected Point2D place(Point2D p) {
+                return p.set(24 + p.x * fontSize() * hScale, 40 + menuText.rows.length * gorillaSize.y * 1.1 + fontSize() + p.y * fontSize());
+            }
+        };
+    }
+
+    @Override
+    public void updateContent() {
+        layer3.update(0.5);
+        menuText.tick();
+    }
+
+    @Override
+    public void drawBackgroundContent() {
+        drawRectangle(topLeft, dimensions, CoreColor.Blue, true);
+        if (!lowendMachine) {
+            layer3.redraw();
+        }
+    }
+
+    public void setSelected(int selectedItem) {
+        this.selectedItem = selectedItem;
+    }
+
+    @Override
+    public void drawForegroundContent() {
+        menuText.drawForegroundContent();
+        if (menuText.done()) infoText.drawForegroundContent();
+        tmp.set(24, (1 + selectedItem) * (gorillaSize.y * 1.1) + Math.min(Math.max(gorillaSize.y / 2.2, 12), 64) + 40);
+        menuGorilla.draw(this, tmp);
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/ProxyCanvas.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/ProxyCanvas.java
new file mode 100644
index 0000000000000000000000000000000000000000..83e575e3244e6eb57cc9d2653a3fd0a05dbc734e
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/ProxyCanvas.java
@@ -0,0 +1,29 @@
+package fi.utu.tech.distributed.gorilla.views;
+
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+public class ProxyCanvas extends Canvas {
+    protected final Canvas backend;
+    protected final Point2D dimensions = new Point2D();
+
+    public ProxyCanvas(Canvas backend) {
+        super(false);
+        this.backend = backend;
+        if (backend.resizable) {
+            backend.peer().widthProperty().addListener(o -> resized());
+            backend.peer().heightProperty().addListener(o -> resized());
+        }
+        resized();
+    }
+
+    @Override
+    protected void resized() {
+        dimensions.set(getWidth(), getHeight());
+    }
+
+    @Override
+    public javafx.scene.canvas.Canvas peer() {
+        return backend.peer();
+    }
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/Views.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/Views.java
new file mode 100644
index 0000000000000000000000000000000000000000..a422d73fa6fe099824b474c44961056af8693abd
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/Views.java
@@ -0,0 +1,73 @@
+package fi.utu.tech.distributed.gorilla.views;
+
+import fi.utu.tech.distributed.gorilla.logic.GameMode;
+import fi.utu.tech.distributed.gorilla.logic.GameState;
+
+import java.util.Map;
+
+public class Views {
+    private final MainCanvas mainCanvas;
+    private final IntroCanvas introCanvas;
+    private final GameCanvas gameCanvas;
+    private final MenuCanvas menuCanvas;
+    private final CanvasSwitcher<GameMode> switcher;
+
+    public Views(MainCanvas main, boolean lowendMachine, boolean synkistely, double tickDuration, long seed) {
+        this.mainCanvas = main;
+        introCanvas = new IntroCanvas(mainCanvas, lowendMachine, synkistely, seed);
+        gameCanvas = new GameCanvas(tickDuration, mainCanvas, null, lowendMachine, seed);
+        menuCanvas = new MenuCanvas(mainCanvas, lowendMachine, seed, "Gorillasota 2029", new String[]{});
+
+        switcher = new CanvasSwitcher<>(mainCanvas, Map.of(
+                GameMode.Intro, introCanvas,
+                GameMode.Game, gameCanvas,
+                GameMode.Menu, menuCanvas
+        ));
+        setMode(GameMode.Intro);
+    }
+
+    public void setMode(GameMode mode) {
+        switch (mode) {
+            case Intro:
+                introCanvas.init();
+                break;
+        }
+        switcher.switchView(mode);
+    }
+
+    public void setSelectedMenuItem(int selectedMenuItem) {
+        menuCanvas.setSelected(selectedMenuItem);
+    }
+
+    public void setMenu(String title, String[] items) {
+        menuCanvas.setMenu(title, items);
+    }
+
+    public void setMenuInfo(String[] items) {
+        menuCanvas.setInfo(items);
+    }
+
+    public void setGameState(GameState gameState) {
+        gameCanvas.setGameState(gameState);
+    }
+
+    public boolean introDone() {
+        return introCanvas.done();
+    }
+
+    public void redraw() {
+        switcher.redraw();
+    }
+
+    public void setVelocity(int v) {
+        gameCanvas.setVelocity(v);
+    }
+
+    public void addVelocity(int v) {
+        gameCanvas.addVelocity(v);
+    }
+
+    public void focusOnMe() {
+        gameCanvas.focusOnMe();
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/Parallax.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/Parallax.java
new file mode 100644
index 0000000000000000000000000000000000000000..8319b3d77cada90181767dac65f8aec5bc3126ac
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/Parallax.java
@@ -0,0 +1,101 @@
+package fi.utu.tech.distributed.gorilla.views.layers;
+
+import fi.utu.tech.distributed.gorilla.engine.SimpleEngine;
+import fi.utu.tech.distributed.gorilla.logic.Move;
+import fi.utu.tech.distributed.gorilla.logic.Player;
+import fi.utu.tech.distributed.gorilla.objects.Gorilla;
+import fi.utu.tech.distributed.gorilla.views.BuildingView;
+import fi.utu.tech.distributed.gorilla.views.ProxyCanvas;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Random;
+
+public class Parallax extends ProxyCanvas {
+    private final Deque<BuildingView> buildings;
+    private final double shade;
+    private final boolean containsGorillas;
+    private final Random generator;
+    private final Point2D tmp = new Point2D();
+    private final Point2D tmp2 = new Point2D(0, 0);
+    private double x = 0;
+
+    public Parallax(Canvas backend, double shade, boolean containsGorillas, long seed) {
+        super(backend);
+        buildings = new LinkedList<>();
+        this.shade = shade;
+        this.containsGorillas = containsGorillas;
+        generator = new Random(seed);
+
+        // initial buildings
+        resized();
+    }
+
+    protected void resized() {
+        super.resized();
+        x = 0;
+        if (buildings == null) return;
+        buildings.clear();
+        addBuildings(getWidth());
+    }
+
+    private void addBuildings(double w) {
+        while (w > 0) {
+            BuildingView bv = newBuilding();
+            w -= bv.width;
+            buildings.addLast(bv);
+        }
+    }
+
+    private BuildingView newBuilding() {
+        return BuildingView.createRandom(generator.nextLong(), 140, 500, shade, tmp, tmp2);
+    }
+
+    public void update(double delta) {
+        // scroll to right
+        if (x < 0 && x + buildings.getFirst().width < 0) {
+            buildings.removeFirst();
+            x = 0;
+        }
+
+        // scroll to left
+        if (delta < 0 && x >= 0) {
+            buildings.removeLast();
+            buildings.addFirst(newBuilding());
+            x = -buildings.getFirst().width;
+        }
+        if (x > 0 && buildings.getLast().width - x < 0) {
+            x = 0;
+        }
+
+        double w = getWidth() + 150;
+        for (BuildingView bv : buildings) w -= bv.width;
+        addBuildings(w);
+
+        x -= delta;
+    }
+
+    private Gorilla gorillaGraphics = new Gorilla(new SimpleEngine(0, 1, 1), new Point2D(), new Player("foo", null, false)) {
+        public Move playTurn() {
+            return null;
+        }
+    };
+
+    @Override
+    public void drawBackgroundContent() {
+        tmp.set(x, 0);
+        tmp2.set(0, 0);
+        for (BuildingView building : buildings) {
+            tmp.set(tmp.x, getHeight() - building.height);
+            building.draw(this, tmp);
+            tmp.add(building.width / 2.0, 0.0);
+            if (containsGorillas && building.width > 100) {
+                gorillaGraphics.place(tmp);
+                gorillaGraphics.draw(this, tmp2);
+            }
+            tmp.add(building.width / 2.0, 0.0);
+        }
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/ScrollingTextView.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/ScrollingTextView.java
new file mode 100644
index 0000000000000000000000000000000000000000..3cb7421729948ed29c58b5bddd7e6d84a0c14f0e
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/ScrollingTextView.java
@@ -0,0 +1,64 @@
+package fi.utu.tech.distributed.gorilla.views.layers;
+
+import fi.utu.tech.oomkit.app.Scheduled;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
+public class ScrollingTextView extends TextView implements Scheduled {
+    protected final Queue<Letter> hiddenLetters = new LinkedList<>();
+    protected final Queue<Letter> visibleLetters = new LinkedList<>();
+    private int currentLine;
+
+    class Letter extends Point {
+        final char value;
+
+        public Letter(int x, int y, char value) {
+            super(x, y);
+            this.value = value;
+        }
+    }
+
+    public boolean done() {
+        return hiddenLetters.isEmpty();
+    }
+
+    public ScrollingTextView(Canvas backend, String[] rows, double size) {
+        super(backend, rows, size);
+        init();
+    }
+
+    public void init() {
+        currentLine = -1;
+        hiddenLetters.clear();
+        visibleLetters.clear();
+        for (int y = 0; y < rows.length; y++)
+            for (int x = 0; x < rows[y].length(); x++)
+                if (charAt(x, y) != ' ') hiddenLetters.add(new Letter(x, y, charAt(x, y)));
+    }
+
+    @Override
+    protected Point2D place(Point2D p) {
+        return super.place(p.add(0, -Math.max(0, currentLine / 2)));
+    }
+
+    @Override
+    public void tick() {
+        if (!hiddenLetters.isEmpty()) {
+            Letter current = hiddenLetters.remove();
+            visibleLetters.add(current);
+            currentLine = current.y;
+        }
+    }
+
+    @Override
+    public void drawForegroundContent() {
+        //drawText(tmp, CoreColor.White, "", 1, true, true);
+        for(Letter l: visibleLetters) {
+            drawCharacter(tmp.set(l.x, l.y), l.value);
+        }
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/TextView.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/TextView.java
new file mode 100644
index 0000000000000000000000000000000000000000..a18f3689d4037134196c017c4299d5eb137d3e92
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/layers/TextView.java
@@ -0,0 +1,63 @@
+package fi.utu.tech.distributed.gorilla.views.layers;
+
+import fi.utu.tech.distributed.gorilla.views.ProxyCanvas;
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+import fi.utu.tech.oomkit.colors.CoreColor;
+
+public class TextView extends ProxyCanvas {
+    private final double fontSize;
+    public String[] rows;
+    private double originalWidth;
+
+    public TextView(Canvas backend, String[] rows, double fontSize) {
+        super(backend);
+        this.rows = rows;
+        this.fontSize = fontSize;
+        originalWidth = getWidth();
+    }
+
+    protected char charAt(int x, int y) {
+        if (y < rows.length) {
+            String rivi = rows[y];
+            if (x < rivi.length())
+                return rivi.charAt(x);
+        }
+        return ' ';
+    }
+
+    protected double fontSize() {
+        return fontSize * getWidth() / originalWidth;
+    }
+
+    protected int rowCount() {
+        return (int) (getHeight() / fontSize()) - 1;
+    }
+
+    protected int colCount() {
+        return (int) (getWidth() / fontSize()) - 1;
+    }
+
+    protected Point2D place(Point2D p) {
+        double f = (int) fontSize();
+        return p.set(f + f / 2.0 + p.x * f, 2.0 * f + f / 4.0 + p.y * f);
+    }
+
+    protected void drawCharacter(Point2D p, char l) {
+        Point2D paikka = place(p);
+        backend.drawCharacter(paikka, CoreColor.White, l, (int) fontSize(), true, false);
+    }
+
+    @Override
+    public void drawBackgroundContent() {
+    }
+
+    protected Point2D tmp = new Point2D();
+
+    @Override
+    public void drawForegroundContent() {
+        for (int y = 0; y < rowCount(); y++)
+            for (int x = 0; x < colCount(); x++)
+                drawCharacter(tmp.set(x, y), charAt(x, y));
+    }
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/objects/ObjectView.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/objects/ObjectView.java
new file mode 100644
index 0000000000000000000000000000000000000000..51e8ff6e090ce6b396067818d015cc4d4c3986cc
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/gorilla/views/objects/ObjectView.java
@@ -0,0 +1,14 @@
+package fi.utu.tech.distributed.gorilla.views.objects;
+
+import fi.utu.tech.oomkit.canvas.Canvas;
+import fi.utu.tech.oomkit.canvas.Point2D;
+
+public interface ObjectView extends Comparable<ObjectView> {
+    int zOrder();
+
+    default int compareTo(ObjectView o) {
+        return zOrder() - o.zOrder();
+    }
+
+    void draw(Canvas canvas, Point2D viewTransform);
+}
\ No newline at end of file
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Maintesti.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Maintesti.java
new file mode 100644
index 0000000000000000000000000000000000000000..f7b0a6be486c5218a555c816ba27288f75a28fb3
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Maintesti.java
@@ -0,0 +1,21 @@
+package fi.utu.tech.distributed.mesh;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+public class Maintesti {
+// ei toimi tällä hetkellä
+	public static void main(String[] args) {
+	/*	Mesh mesh  = new Mesh(3007);
+		mesh.start();
+		try {
+			mesh.connect(InetAddress.getLocalHost(), 3007);
+			
+		} catch (UnknownHostException e) {
+			e.printStackTrace();
+		}
+		mesh.broadcast(new Viesti("420","0",":D"));
+		*/
+	}
+
+}
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Mesh.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Mesh.java
new file mode 100644
index 0000000000000000000000000000000000000000..5ecb4d4ac1d42a2920a2dda5c57d8b76d1c23d5a
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Mesh.java
@@ -0,0 +1,227 @@
+package fi.utu.tech.distributed.mesh;
+
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+import fi.utu.tech.distributed.gorilla.logic.GorillaLogic;
+import javafx.application.Platform;
+
+public class Mesh extends Thread {
+	
+	private int port;
+	private List<Handler> lista;
+	private List<Long> tokenlista;
+	private final String meshID; // tietyn solmun "nimi"
+	private Random random;
+	private GorillaLogic gorillaLogic;
+	
+	
+	/**
+     * Luo Mesh-palvelininstanssi
+     * @param port Portti, jossa uusien vertaisten liittymispyyntöjä kuunnellaan
+     */
+    public Mesh(int port, GorillaLogic gorillaLogic) {
+    	this.gorillaLogic = gorillaLogic;
+    	this.port = port;
+    	lista = Collections.synchronizedList(new ArrayList<Handler>());
+    	tokenlista = Collections.synchronizedList(new ArrayList<Long>());
+    	random = new Random();
+    	meshID = Integer.toString((random.nextInt()+1));
+    }
+    
+    
+    /**
+     *  Käynnistä uusien vertaisten kuuntelusäie
+     */
+    public void run() {
+    	try{
+    		ServerSocket listener = new ServerSocket(port);
+    		
+    		while (true) {
+    			Socket clientSocket = listener.accept();
+    			Handler c = new Handler(clientSocket, this, gorillaLogic);
+    			lista.add(c);
+    			c.start();
+    		}
+
+    	}catch(Exception e) {e.printStackTrace();}
+
+    }
+
+    
+    /**
+     * Lähetä hyötykuorma kaikille vastaanottajille
+     * @param o Lähetettävä hyötykuorma
+     */
+    public void broadcast(Message joo) {
+    	tokenlista.add(joo.getTunniste());
+    	//looppi joka käy kaikki threadit läpi
+    	synchronized (lista){
+    	for(Handler h : lista) {
+    		try {
+    			h.send(joo);
+    		}
+    		catch(Exception e) {e.printStackTrace();}
+    		
+    	}}
+    }
+    
+    public void broadcast(Serializable s) {
+    	//System.out.println("Lähtevä paketti: " + s);
+    	this.broadcast(new Message(meshID, "0", s));
+    }
+    
+
+    /**
+     * Lähetä hyötykuorma valitulle vertaiselle
+     * @param o Lähetettävä hyötykuorma
+     * @param recipient Vastaanottavan vertaisen tunnus
+     */
+    public void send(Serializable joo, long recipient) {
+
+    }
+    
+
+    /**
+     * Sulje mesh-palvelin ja kaikki sen yhteydet 
+     */
+    public void close() {
+    	
+    }
+    
+
+    /**
+     * Lisää token, eli "viestitunniste"
+     * Käytännössä merkkaa viestin tällä tunnisteella luetuksi
+     * Määreenä private, koska tätä käyttävä luokka on sisäluokka (inner class)
+     * Jos et käytä sisäluokkaa, pitää olla public
+     * @param token Viestitunniste 
+     */
+    void addToken(long token) {
+    	//lisää tämän viestin nähdyksi tälle MeshNodelle
+    	tokenlista.add(token);
+    }
+    
+
+    /**
+     * Tarkista, onko viestitunniste jo olemassa
+     * Määreenä private, koska tätä käyttävä luokka on sisäluokka (inner class)
+     * Jos et käytä sisäluokkaa, pitää olla public
+     * @param token Viestitunniste 
+     */
+    boolean tokenExists(long token) {
+    	synchronized(tokenlista) {
+    	for(long l : tokenlista) {
+    		if(token == l) {return true;}
+    	}}
+    	return false;
+    }
+    
+    
+
+    /**
+     * Yhdistä tämä vertainen olemassaolevaan Mesh-verkkoon
+     * @param addr Solmun ip-osoite, johon yhdistetään
+     * @param port Portti, jota vastapuolinen solmu kuuntelee
+     */
+    public void connect(InetAddress addr, int port) {
+    	try {
+    	Socket s = new Socket(addr,port);
+    	Handler clientHandler = new Handler(s,this, gorillaLogic);
+    	lista.add(clientHandler);
+    	clientHandler.start();
+    	}catch(Exception e) {e.printStackTrace();}
+    }
+    
+    public String getMeshID() {return meshID;}
+    
+ //-----------------------------------------------------------------------------------------------
+    class Handler extends Thread {
+    	
+    	private Socket client;
+    	private Mesh m;
+    	private OutputStream out;
+    	private InputStream in;
+    	private ObjectInputStream oIn;
+    	private ObjectOutputStream oOut;
+    	private GorillaLogic gorillaLogic;
+    	
+    	//Server
+    	public Handler (Socket clientSocket, Mesh m, GorillaLogic gorillaLogic) {
+    		this.gorillaLogic = gorillaLogic;
+    		this.client = clientSocket;
+    		this.m = m;
+    		
+    	}
+
+    	
+    	@Override
+    	public void run() {
+    		try {
+    			out = client.getOutputStream();
+    			in = client.getInputStream();
+    			
+    			oOut = new ObjectOutputStream(out);
+    			oIn = new ObjectInputStream(in);
+    		}catch(Exception e) {e.printStackTrace();}
+    		try {
+    			while(true) {
+    				Object o = oIn.readObject();
+    				
+    				//System.out.println("Saapuva paketti: " + ((Message)o).getPayload());
+    				
+    				if(!(o instanceof Message)){continue;}
+    				final Message x = (Message)o;
+    				
+    				
+    				if(m.tokenExists(x.getTunniste())) {continue;}
+    				else if(x.getReceiver().equals("0")) {
+    					
+    					Platform.runLater(()->gorillaLogic.process(x));
+    					
+    					m.addToken(x.getTunniste());
+    					m.broadcast(x);
+    				}
+    				else if(x.getReceiver().equals(m.meshID)) {
+    					m.addToken(x.getTunniste());
+    				}
+    				else {
+    					m.addToken(x.getTunniste());
+    					m.broadcast(x);
+    				}
+    					}
+    		
+    		} catch (Exception e) {e.printStackTrace();}
+    	}
+    	
+
+    	Socket getSocket() {
+    		return client;
+    	}
+    	
+    	
+    	public void send(Serializable v) {
+    		try {
+    			oOut.writeObject(v);
+    			oOut.flush();
+    		} catch(Exception e) {e.printStackTrace();}
+    	}
+    	
+    	
+    	
+    }
+
+}
+
+
+
diff --git a/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Message.java b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Message.java
new file mode 100644
index 0000000000000000000000000000000000000000..e603c6c148e9a1f3e9f930ebc7b24c103ef44cf6
--- /dev/null
+++ b/distributed-gorilla-master/src/main/java/fi/utu/tech/distributed/mesh/Message.java
@@ -0,0 +1,38 @@
+package fi.utu.tech.distributed.mesh;
+
+import java.io.Serializable;
+import java.util.Random;
+
+/**
+ * TODO: make compatible with network play
+ */
+public final class Message implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+	
+	private final long tunniste;
+	private Random random;
+	private String senderID;
+	private String receiverID; //arvo 0 tarkoittaa broadcastia
+	private Serializable payload;
+	
+	public Message(String senderID,String receiverID, Serializable payload) {
+		this.payload = payload;
+		this.senderID = senderID;
+		this.receiverID = receiverID;
+		random = new Random();
+		tunniste = random.nextLong();
+		
+		
+		
+	}
+	public Serializable getPayload() {return payload;}
+	
+	public long getTunniste() {return tunniste;}
+	
+	public String getSender() {return senderID;}
+	
+	public String getReceiver() {return receiverID;}
+}
+
+
diff --git a/distributed-gorilla-master/src/main/resources/banana.png b/distributed-gorilla-master/src/main/resources/banana.png
new file mode 100644
index 0000000000000000000000000000000000000000..c2c041e4dfeb45e499689ffb9e1ca50b8b4e72a7
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/banana.png differ
diff --git a/distributed-gorilla-master/src/main/resources/banana2.png b/distributed-gorilla-master/src/main/resources/banana2.png
new file mode 100644
index 0000000000000000000000000000000000000000..1724f8c788de271b765fef29091f4f01c9bfc710
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/banana2.png differ
diff --git a/distributed-gorilla-master/src/main/resources/cloud1.png b/distributed-gorilla-master/src/main/resources/cloud1.png
new file mode 100644
index 0000000000000000000000000000000000000000..1ae02b8ba92ac5c915f04ad9b13615e953d72a4a
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/cloud1.png differ
diff --git a/distributed-gorilla-master/src/main/resources/cloud2.png b/distributed-gorilla-master/src/main/resources/cloud2.png
new file mode 100644
index 0000000000000000000000000000000000000000..ee3179c76d5becb51f22c8018c865133a3ba3cb5
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/cloud2.png differ
diff --git a/distributed-gorilla-master/src/main/resources/monkey.png b/distributed-gorilla-master/src/main/resources/monkey.png
new file mode 100644
index 0000000000000000000000000000000000000000..c9bbddd05c2388b210caeb3b8bb0b66f8e420c6a
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/monkey.png differ
diff --git a/distributed-gorilla-master/src/main/resources/monkey3.png b/distributed-gorilla-master/src/main/resources/monkey3.png
new file mode 100644
index 0000000000000000000000000000000000000000..b231a601d3b00ace565f19e7cb1399beaecb2042
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/monkey3.png differ
diff --git a/distributed-gorilla-master/src/main/resources/sun.png b/distributed-gorilla-master/src/main/resources/sun.png
new file mode 100644
index 0000000000000000000000000000000000000000..4f2b652ea70ad828e371be2e2898b836563c9af1
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/sun.png differ
diff --git a/distributed-gorilla-master/src/main/resources/sun2.png b/distributed-gorilla-master/src/main/resources/sun2.png
new file mode 100644
index 0000000000000000000000000000000000000000..0c0e3fb05db48a5c1eb200453606ad0ee5b37e0c
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/sun2.png differ
diff --git a/distributed-gorilla-master/src/main/resources/tombstone.png b/distributed-gorilla-master/src/main/resources/tombstone.png
new file mode 100644
index 0000000000000000000000000000000000000000..c26f30617a6911736effdf15c26c2d90f1026f6f
Binary files /dev/null and b/distributed-gorilla-master/src/main/resources/tombstone.png differ
diff --git a/distributed-gorilla-master/src/test/java/fi/utu/tech/oomkit/examples/grid/EmptyTest.java b/distributed-gorilla-master/src/test/java/fi/utu/tech/oomkit/examples/grid/EmptyTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..efea540b39d98badebc03ee0f9c9b82e2c636ae4
--- /dev/null
+++ b/distributed-gorilla-master/src/test/java/fi/utu/tech/oomkit/examples/grid/EmptyTest.java
@@ -0,0 +1,11 @@
+package fi.utu.tech.oomkit.examples.grid;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class EmptyTest {
+	@Test
+	public void testSomething() {
+        Assertions.assertTrue(true);
+	}
+}
diff --git a/distributed-gorilla-master/src/test/resources/jqwik.properties b/distributed-gorilla-master/src/test/resources/jqwik.properties
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/distributed-gorilla-master/web/screenshot1.png b/distributed-gorilla-master/web/screenshot1.png
new file mode 100644
index 0000000000000000000000000000000000000000..9cabe64fff695a917fe7261a5c533fe9971b02a9
Binary files /dev/null and b/distributed-gorilla-master/web/screenshot1.png differ
diff --git a/threadrunner-assignment-master/.classpath b/threadrunner-assignment-master/.classpath
new file mode 100644
index 0000000000000000000000000000000000000000..234db15be49506f267ac3a47dfeda3c6d52acf36
--- /dev/null
+++ b/threadrunner-assignment-master/.classpath
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+			<attribute name="test" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/threadrunner-assignment-master/.gitignore b/threadrunner-assignment-master/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..1449398ec6be8ae55db8bcbbadee618a391dfe97
--- /dev/null
+++ b/threadrunner-assignment-master/.gitignore
@@ -0,0 +1,30 @@
+# Eclipse
+bin/
+.project
+.settings/
+ 
+# Intellij
+.idea/
+*.iml
+*.iws
+ 
+# Mac
+.DS_Store
+ 
+# Maven
+log/
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+# https://github.com/takari/maven-wrapper#usage-without-binary-jar
+.mvn/wrapper/maven-wrapper.jar
+
+
+# VScode
+.vscode/
diff --git "a/threadrunner-assignment-master/Harkkaty\303\2661_t3.pdf" "b/threadrunner-assignment-master/Harkkaty\303\2661_t3.pdf"
new file mode 100644
index 0000000000000000000000000000000000000000..2351ac0d52dc637dd03a03bcafe257ac9d5fbccd
Binary files /dev/null and "b/threadrunner-assignment-master/Harkkaty\303\2661_t3.pdf" differ
diff --git a/threadrunner-assignment-master/README.md b/threadrunner-assignment-master/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..7684ec87e7b9525027a32c78ab269ff8c8822d54
--- /dev/null
+++ b/threadrunner-assignment-master/README.md
@@ -0,0 +1,95 @@
+# Hajautetut ohjelmistojärjestelmät 2019
+
+# Harjoitustyö 1 tehtävänanto
+
+Ensimmäisessä työssä harjoitellaan säikeiden luontia ja tehtävien jakamista niille. Lisäksi tutkitaan, miten tehtävien suoritusajat vaihtelevat erilaisilla tehtävä tyypeillä. Harjoitus pohjautuu valmiiseen ohjelmarunkoon, johon ryhmän tehtävänä on täydentää puuttuvat osat. ThreadRunner-ohjelma käyttää JavaFx-ympäristöä graafisen käyttöliittymänsä toteutukseen. Harjoitustyön tekemiseen ei kuitenkaan tarvita JavaFx osaamista.
+
+![Semantic description of image](/images/mainwindow.png "Main window")
+
+## Ohjelman käyttöliittymä
+
+- Select task type
+
+   Tällä valinnalla asetetaan tehtävän datajoukon tyyppi. 
+- Select worker type
+
+   Asettaa käytettävän tehtävän tyypin.
+- Amount of tasks
+
+   Säikeissä ajattavien tehtävien määrä.
+- Set load
+
+   Säätää yksittäisen tehtävän suoritusaikaa. 
+- Set threadcount
+
+   Asettaa tehtävässä käytettävien säikeiden määrän. Valikon maksimiarvoksi tulee automaattisesti käytössä olevien ytimien 
+   määrää vastaava arvo. Oletusarvona on kaksi, joka on virtuaalikoneen oletusprosessorimäärä.
+   
+- Run static
+
+   Käynnistää tehtävän suorituksen staattisella tehtäväjaolla. Tämä toteutetaan tehtävässä 1.
+- Run dynamic
+
+   Käynnistää suorituksen dynaamisella tehtäväjaolla. Tämä toteutetaan tehtävässä 2.
+
+## Ohjelman rakenteen kuvaus
+
+### App.java ja fi.utu.tech.UI pakkaus
+
+![Semantic description of image](/images/AppUIUML.png "App.java ja fi.utu.tech.UI")
+
+App.java on ohjelman pääluokka, joka sisältää main-metodin. Se sisältää myös ajojen käynnistykseen ja suoritusajan mittaamiseen käytetyt metodit. Pakkaus UI sisältää graafiseen käyttöliitymän toimintaan liittyvät luokat.
+
+### fi.utu.tech.tasks
+
+![Semantic description of image](/images/tasksUML.png "fi.utu.tech.tasks")
+
+Tehtävälistojen generointi. Pakkauksesta löytyy erityyppisiä tehtävälistoja generoivia luokkia.
+
+### fi.utu.tech.workers
+
+![Semantic description of image](/images/workersUML.png "fi.utu.tech.workers")
+
+Tästä pakkauksesta löytyvät säikeissä suoritettavat työt. 
+
+### fi.utu.tech.dispatchers
+
+![Semantic description of image](/images/dispatchersUML.png "fi.utu.tech.dispatchers")
+
+Fi.utu.tech.dispatchers pakkaus sisältää töiden säikeille jakamiseen liittyvät toiminteet.
+
+Tämä pakkaus on harjoitustyön suorittamisen kannalta tärkein. Täältä löytyvät ne luokat, StaticDispatcher ja DynamicDispatcher, joissa tehtävissä 1 ja 2 vaaditut töiden jaot säikeille suoritetaan.
+
+
+## Tehtävät
+
+### Tehtävä 1. Staattinen tehtävänjako
+
+Ensimmäisessä tehtävässä toteutetaan töiden jako säikeille niin, että jokainen säie saa suoritettavakseen kiinteän määrän tehtäviä. Säikeitä luodaan pyydetty määrä ja niistä jokaiselle annetaan yhtä suuri osa generoidusta tehtävälistasta suoritettavaksi. 
+
+Tehtävä ovat kokonaislukumuotoisessa ArrayList-tietorakenteessa, jonka voi jakaa säiemäärää vastaaviin osiin. 
+
+Säikein suoritamien tehtävien suoritusajat vaihtelevat ja säikeet saavat työnsä valmiiksi eri aikoinan. Staattisessa jaossa nopeammin valmistuvat säikeet jäävät odottamaan muiden valmistumista eikä jäljellä olevia tehtäviä jaeta uudelleen jo valmistuneille säikeille.
+
+### Tehtävä 2. Dynaaminen tehtävänjako
+
+Tehtävässä kaksi säikeet suorittavat työtä kuten tehtävässä yksi, mutta nyt työ jaetaan eri tavalla. 
+
+Tarkoituksena on toteuttaa jako niin, että kaikille säikeille riittää suoritettavaa, eivätkä nopeammin valmistuvat säikeet odota hitaampia tekemättä mitään. 
+
+Tämä toteutetaan jakamalla saatu tehtäväjoukko huomattavasti säikeiden määrään suurempaan määrään osajoukkoja, esimerkiksi 10 kertaa säikeiden määrä. Jokaisen ajettava säie poimii tästä osajoukkojen joukosta itselleen tehtäväjoukkoja niin kauan kuin niitä riittää. 
+Toisin sanoen aina kun yksi laskenta valmistuu, säie saa úuden tehtävän jonosta.
+
+### Tehtävä 3. Selvitystyö
+Vastatkaa seuraaviin kysymyksiin lyhyesti perustellen. Apuna voi käyttää työssä toteutettua ohjelmaa 
+ja sillä kokeilla, miten suoritusajat muuttuvat erilaisilla asetuksilla ja tehtävienjakotyypeillä.
+
+1.  Tutustukaa Threadrunner-ohjelman rakenteeseen. Selostakaa lyhyesti, miten ohjelman suoritus kulkee. 
+
+2.	Missä tilanteessa on järkevää käyttää staattista jakoa ja missä dynaamista? Onko tilanteita, jossa on samantekevää, kumpi valintaan? Entä on tilanteita, joissa toinen on selvästi järkevämpi valinta?
+
+3.	Oletetaan, että koneessa voidaan ajaa 8 säiettä aidosti samanaikaisina. Ajatellaan graafisella käyttöliittymällä varustettua ohjelmaa, joka suorittaa raskasta laskentaa säikeissä. Koneessa ajataan samanaikaisesti myös muita ohjelmia. Montako samanaikaista säiettä on järkevää käyttää? Perustele.   
+
+4.	Threadrunner-ohjelman käyttöliittymä odottaa säikeiden valmistumista eikä vastaa sillä aikaa käytäjän pyyntöihin eli on toisin sanoen aivan jumissa. Miten ohjelmaa olisi järkevää muuttaa, jotta käyttöliittymä olisi kokoajan käytössä? Kuvatkaa vastaukseen tarvittavat luokat ja niiden metodit. Metodien toteuksia ei tarvitse tehdä.
+
+
diff --git a/threadrunner-assignment-master/images/AppUIUML.png b/threadrunner-assignment-master/images/AppUIUML.png
new file mode 100644
index 0000000000000000000000000000000000000000..d1c58eb3214bcd3e4e56a44ec2c6ad2f419de53a
Binary files /dev/null and b/threadrunner-assignment-master/images/AppUIUML.png differ
diff --git a/threadrunner-assignment-master/images/dispatchersUML.png b/threadrunner-assignment-master/images/dispatchersUML.png
new file mode 100644
index 0000000000000000000000000000000000000000..54f3290a9a182d21d34fa1b5b2f3deed6b459f5d
Binary files /dev/null and b/threadrunner-assignment-master/images/dispatchersUML.png differ
diff --git a/threadrunner-assignment-master/images/mainwindow.png b/threadrunner-assignment-master/images/mainwindow.png
new file mode 100644
index 0000000000000000000000000000000000000000..2701d9980688c592b8cebedd24a05991c0939383
Binary files /dev/null and b/threadrunner-assignment-master/images/mainwindow.png differ
diff --git a/threadrunner-assignment-master/images/tasksUML.png b/threadrunner-assignment-master/images/tasksUML.png
new file mode 100644
index 0000000000000000000000000000000000000000..3d87a64c701e1cbc0354389bb4f48547cd3467e7
Binary files /dev/null and b/threadrunner-assignment-master/images/tasksUML.png differ
diff --git a/threadrunner-assignment-master/images/workersUML.png b/threadrunner-assignment-master/images/workersUML.png
new file mode 100644
index 0000000000000000000000000000000000000000..98193abc1f46960a5bfd439461f99da616416d7c
Binary files /dev/null and b/threadrunner-assignment-master/images/workersUML.png differ
diff --git a/threadrunner-assignment-master/pom.xml b/threadrunner-assignment-master/pom.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0666bda1fa38c7b7bdc14c2cb458be3838712f6c
--- /dev/null
+++ b/threadrunner-assignment-master/pom.xml
@@ -0,0 +1,129 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>fi.utu.tech</groupId>
+    <artifactId>ThreadRunner-assignment</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>ThreadRunner</name>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.mainclass>fi.utu.tech.ThreadRunner.App</project.mainclass>
+        <jdk.version>11</jdk.version>
+        <maven.compiler.source>${jdk.version}</maven.compiler.source>
+        <maven.compiler.target>${jdk.version}</maven.compiler.target>
+        <javafx.version>13</javafx.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-controls</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjfx</groupId>
+            <artifactId>javafx-fxml</artifactId>
+            <version>${javafx.version}</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>1.6.0</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <mainClass>${project.mainclass}</mainClass>
+             </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.0</version>
+                <configuration>
+                    <release>${jdk.version}</release>
+                    <source>${jdk.version}</source>
+					<target>${jdk.version}</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.openjfx</groupId>
+                <artifactId>javafx-maven-plugin</artifactId>
+                <version>0.0.1</version>
+                <configuration>
+                    <mainClass>${project.mainclass}</mainClass>
+                </configuration>
+            </plugin>
+            <plugin>
+    			<groupId>org.apache.maven.plugins</groupId>
+    			<artifactId>maven-dependency-plugin</artifactId>
+    			<executions>
+       			    <execution>
+            	        <id>copy-dependencies</id>
+            	        <phase>prepare-package</phase>
+            		    <goals>
+                    		<goal>copy-dependencies</goal>
+                		</goals>
+                        <configuration>
+                            <outputDirectory>
+                                ${project.build.directory}/libs
+                            </outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>fully.qualified.MainClass</mainClass>
+                        </manifest>
+                    </archive>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>com.zenjava</groupId>
+                <artifactId>javafx-maven-plugin</artifactId>
+                <version>8.8.3</version>
+                <configuration>
+                    <mainClass>${project.mainclass}</mainClass>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <version>2.10</version>
+                <configuration>
+                    <downloadSources>true</downloadSources>
+                    <downloadJavadocs>false</downloadJavadocs>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>3.1.2</version>
+                <configuration>
+                    <excludes>
+                        <exclude>**/log4j.properties</exclude>
+                    </excludes>
+                    <archive>
+                        <manifest>
+                            <mainClass>${project.mainclass}</mainClass>
+                            <addClasspath>true</addClasspath>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/App.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/App.java
new file mode 100644
index 0000000000000000000000000000000000000000..beee561f4594a1804d2683a19a14a50d45ddba9a
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/App.java
@@ -0,0 +1,101 @@
+package fi.utu.tech.ThreadRunner;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+
+import fi.utu.tech.ThreadRunner.UI.MainWindowController;
+import fi.utu.tech.ThreadRunner.UI.StatisticLine;
+import fi.utu.tech.ThreadRunner.dispatchers.ControlSet;
+import fi.utu.tech.ThreadRunner.dispatchers.Dispatcher;
+import fi.utu.tech.ThreadRunner.dispatchers.DynamicDispatcher;
+import fi.utu.tech.ThreadRunner.dispatchers.WithOutThreadsDispatcher;
+import fi.utu.tech.ThreadRunner.dispatchers.StaticDispatcher;
+import fi.utu.tech.ThreadRunner.tasks.TaskFactory;
+import fi.utu.tech.ThreadRunner.workers.WorkerFactory;
+
+/**
+ * ThreadRunner App
+ * 
+ * DO NOT EDIT THIS FILE
+ * 
+ * Sovelluksen pääluokka
+ * 
+ * @author Jari Lehto <jaanle@utu.fi>
+ * @version 1.0
+ * @since 1.0
+ */
+
+public class App extends Application {
+
+	private static Scene scene;
+	private static MainWindowController controller;
+
+	@Override
+	public void start(Stage stage) throws IOException {
+		FXMLLoader loader = new FXMLLoader(getClass().getResource("mainWindow.fxml"));
+		Parent root = loader.load();
+		controller = loader.getController();
+		setValues();
+
+		scene = new Scene(root);
+		stage.setMinHeight(600);
+		stage.setMinWidth(800);
+		stage.setTitle("ThreadRunner");
+		stage.setScene(scene);
+		stage.show();
+	}
+
+	private void setValues() throws IOException {
+		controller.fillWorkerType(WorkerFactory.getWorkerTypes());
+		controller.fillTaskType(TaskFactory.getTaskTypes());
+	}
+
+	public static void main(String[] args) {
+		launch();
+	}
+
+	public static void runStatic(ControlSet controlSet) {
+		Dispatcher disp = new StaticDispatcher();
+		long startTime = System.nanoTime();
+		disp.dispatch(controlSet);
+		Float timing = Float.valueOf((System.nanoTime() - startTime) / (1000000));
+		try {
+			controller.addStaticResult(new StatisticLine(controlSet, timing));
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public static void runDynamic(ControlSet controlSet) {
+		Dispatcher disp = new DynamicDispatcher();
+		long startTime = System.nanoTime();
+		disp.dispatch(controlSet);
+		Float timing = Float.valueOf((System.nanoTime() - startTime) / (1000000));
+		try {
+			controller.addDynamicResult(new StatisticLine(controlSet, timing));
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public static void runWot(ControlSet controlSet) {
+		Dispatcher disp = new WithOutThreadsDispatcher();
+		long startTime = System.nanoTime();
+		disp.dispatch(controlSet);
+		Float timing = Float.valueOf((System.nanoTime() - startTime) / (1000000));
+		try {
+			controller.addWotResult(new StatisticLine(controlSet, timing));
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+}
+
+/*
+ * DO NOT EDIT THIS FILE
+ */
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/DO_NOT_EDIT_APP.JAVA b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/DO_NOT_EDIT_APP.JAVA
new file mode 100644
index 0000000000000000000000000000000000000000..7ad6afa46882ef9372b5698d6f96bfa2b9e989c0
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/DO_NOT_EDIT_APP.JAVA
@@ -0,0 +1 @@
+There is no need to edit App.java
\ No newline at end of file
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/DO_NOT_EDIT_FILES_IN_THIS_FOLDER b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/DO_NOT_EDIT_FILES_IN_THIS_FOLDER
new file mode 100644
index 0000000000000000000000000000000000000000..6d21862260e3e789aa19d95c57a7b1033c1d237e
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/DO_NOT_EDIT_FILES_IN_THIS_FOLDER
@@ -0,0 +1 @@
+Editing of files in this folder is not needed.
\ No newline at end of file
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/MainWindowController.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/MainWindowController.java
new file mode 100644
index 0000000000000000000000000000000000000000..c13fef4ad1dc45e7219398a0676f23e5e6d7b3f4
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/MainWindowController.java
@@ -0,0 +1,193 @@
+package fi.utu.tech.ThreadRunner.UI;
+
+import java.io.IOException;
+
+import fi.utu.tech.ThreadRunner.App;
+import fi.utu.tech.ThreadRunner.dispatchers.ControlSet;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.fxml.FXML;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.Spinner;
+import javafx.scene.control.SpinnerValueFactory;
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableView;
+import javafx.scene.control.cell.PropertyValueFactory;
+import javafx.scene.image.ImageView;
+
+/*
+ * Käyttöliittymän kontrolleriluokka. Luokkaa ei esitelle tarkemmin. Näihin tutustutaan Käyttöliittymät-kurssilla.
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class MainWindowController {
+	@FXML
+	private ComboBox<String> taskTypeComboBox;
+	@FXML
+	private ComboBox<String> workerTypeComboBox;
+	@FXML
+	private Spinner<Integer> amountTasksSpinner;
+	@FXML
+	private Spinner<Integer> maxTimeSpinner;
+	@FXML
+	private Spinner<Integer> threadCountSpinner;
+	@FXML
+	private ImageView taskImage;
+
+	@FXML
+	private TableView<StatisticLine> staticTable;
+	@FXML
+	private TableColumn<StatisticLine, String> staticTaskTypeColumn;
+	@FXML
+	private TableColumn<StatisticLine, String> staticWorkerTypeColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> staticAmountTaskColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> staticMaxTimeColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> staticThreadCountColumn;
+	@FXML
+	private TableColumn<StatisticLine, Float> staticTimeTypeColumn;
+
+	@FXML
+	private TableView<StatisticLine> dynamicTable;
+	@FXML
+	private TableColumn<StatisticLine, String> dynamicTaskTypeColumn;
+	@FXML
+	private TableColumn<StatisticLine, String> dynamicWorkerTypeColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> dynamicAmountTaskColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> dynamicMaxTimeColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> dynamicThreadCountColumn;
+	@FXML
+	private TableColumn<StatisticLine, Float> dynamicTimeTypeColumn;
+
+	@FXML
+	private TableView<StatisticLine> wotTable;
+	@FXML
+	private TableColumn<StatisticLine, String> wotTaskTypeColumn;
+	@FXML
+	private TableColumn<StatisticLine, String> wotWorkerTypeColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> wotAmountTaskColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> wotMaxTimeColumn;
+	@FXML
+	private TableColumn<StatisticLine, Integer> wotThreadCountColumn;
+	@FXML
+	private TableColumn<StatisticLine, Float> wotTimeTypeColumn;
+
+	private final ObservableList<StatisticLine> staticData = FXCollections.observableArrayList();
+
+	private final ObservableList<StatisticLine> dynamicData = FXCollections.observableArrayList();
+
+	private final ObservableList<StatisticLine> wotData = FXCollections.observableArrayList();
+
+	@FXML
+	public void initialize() {
+		initSpinners();
+		initTables();
+	}
+
+	private void initSpinners() {
+		threadCountSpinner.setValueFactory(
+				new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Runtime.getRuntime().availableProcessors()));
+		threadCountSpinner.getValueFactory().setValue(Integer.valueOf(2));
+		maxTimeSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 1000));
+		maxTimeSpinner.getValueFactory().setValue(Integer.valueOf(10));
+		amountTasksSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 10000));
+		amountTasksSpinner.getValueFactory().setValue(Integer.valueOf(20));
+	}
+
+	private void initTables() {
+		staticTaskTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, String>("taskType"));
+		staticWorkerTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, String>("workerType"));
+		staticAmountTaskColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("amountTasks"));
+		staticMaxTimeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("maxTime"));
+		staticThreadCountColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("threadCount"));
+		staticTimeTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Float>("time"));
+
+		staticTable.setItems(staticData);
+
+		dynamicTaskTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, String>("taskType"));
+		dynamicWorkerTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, String>("workerType"));
+		dynamicAmountTaskColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("amountTasks"));
+		dynamicMaxTimeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("maxTime"));
+		dynamicThreadCountColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("threadCount"));
+		dynamicTimeTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Float>("time"));
+
+		dynamicTable.setItems(dynamicData);
+
+		wotTaskTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, String>("taskType"));
+		wotWorkerTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, String>("workerType"));
+		wotAmountTaskColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("amountTasks"));
+		wotMaxTimeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("maxTime"));
+		wotThreadCountColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Integer>("threadCount"));
+		wotTimeTypeColumn.setCellValueFactory(new PropertyValueFactory<StatisticLine, Float>("time"));
+
+		wotTable.setItems(wotData);
+
+	}
+
+	@FXML
+	private void runStatic() throws IOException {
+		App.runStatic(new ControlSet(taskTypeComboBox.getValue(), workerTypeComboBox.getValue(),
+				maxTimeSpinner.getValue(), threadCountSpinner.getValue(), amountTasksSpinner.getValue()));
+	}
+
+	@FXML
+	private void runDynamic() throws IOException {
+		App.runDynamic(new ControlSet(taskTypeComboBox.getValue(), workerTypeComboBox.getValue(),
+				maxTimeSpinner.getValue(), threadCountSpinner.getValue(), amountTasksSpinner.getValue()));
+
+	}
+
+	@FXML
+	private void runWot() throws IOException {
+		App.runWot(new ControlSet(taskTypeComboBox.getValue(), workerTypeComboBox.getValue(), maxTimeSpinner.getValue(),
+				threadCountSpinner.getValue(), amountTasksSpinner.getValue()));
+
+	}
+
+	@FXML
+	public void fillTaskType(String[] list) throws IOException {
+		taskTypeComboBox.getItems().addAll(list);
+		taskTypeComboBox.getSelectionModel().selectFirst();
+	}
+
+	@FXML
+	public void fillWorkerType(String[] list) throws IOException {
+		workerTypeComboBox.getItems().addAll(list);
+		workerTypeComboBox.getSelectionModel().select("SleepWorker");
+		;
+	}
+
+	@FXML
+	public void fillMaxTimeSpinner() throws IOException {
+		maxTimeSpinner.getValueFactory().setValue(Integer.valueOf(50));
+
+	}
+
+	@FXML
+	public void addStaticResult(StatisticLine result) throws IOException {
+		staticData.add(result);
+
+	}
+
+	@FXML
+	public void addDynamicResult(StatisticLine result) throws IOException {
+		dynamicData.add(result);
+
+	}
+
+	@FXML
+	public void addWotResult(StatisticLine result) throws IOException {
+		wotData.add(result);
+
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/README.md b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..957a59d9d0990fe8258e4371f9c749a461b94ecd
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/README.md
@@ -0,0 +1,3 @@
+## Package fi.utu.tech.Threadrunner.UI
+
+Tämän pakkauksen luokat liittyvät käyttöliittymän toimintaan. Näitä et tarvitse tehtävien 1 ja 2 suorittamisessa.
\ No newline at end of file
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/StatisticLine.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/StatisticLine.java
new file mode 100644
index 0000000000000000000000000000000000000000..1a2bac834ae2fdef7038b6e67c69238bcff261ea
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/UI/StatisticLine.java
@@ -0,0 +1,80 @@
+package fi.utu.tech.ThreadRunner.UI;
+
+import javafx.beans.property.SimpleStringProperty;
+import fi.utu.tech.ThreadRunner.dispatchers.ControlSet;
+import javafx.beans.property.SimpleFloatProperty;
+import javafx.beans.property.SimpleIntegerProperty;
+
+/*
+ * Tulostaulukon yhden rivin data mallintava luokka. Näihin tutustutaan Käyttöliittymät-kurssilla.
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class StatisticLine {
+	private final SimpleStringProperty taskType;
+	private final SimpleStringProperty workerType;
+	private final SimpleIntegerProperty amountTasks;
+	private final SimpleIntegerProperty maxTime;
+	private SimpleIntegerProperty threadCount;
+	private final SimpleFloatProperty time;
+
+	public StatisticLine(ControlSet controlSet, Float time) {
+		this.taskType = new SimpleStringProperty(controlSet.getTaskType());
+		this.workerType = new SimpleStringProperty(controlSet.getWorkerType());
+		this.amountTasks = new SimpleIntegerProperty(controlSet.getAmountTasks());
+		this.maxTime = new SimpleIntegerProperty(controlSet.getMaxTime());
+		this.threadCount = new SimpleIntegerProperty(controlSet.getThreadCount());
+		this.time = new SimpleFloatProperty(time);
+	}
+
+	public String getTaskType() {
+		return taskType.get();
+	}
+
+	public void setTaskType(String tasktype) {
+		taskType.set(tasktype);
+	}
+
+	public String getWorkerType() {
+		return workerType.get();
+	}
+
+	public void setWorkerType(String workertype) {
+		workerType.set(workertype);
+	}
+
+	public Integer getAmountTasks() {
+		return amountTasks.get();
+	}
+
+	public void setAmountTasks(Integer amount) {
+		amountTasks.set(amount);
+	}
+
+	public Integer getMaxTime() {
+		return maxTime.get();
+	}
+
+	public void setMaxTime(Integer itime) {
+		maxTime.set(itime);
+	}
+
+	public Integer getThreadCount() {
+		return threadCount.get();
+	}
+
+	public void setThreadCount(Integer count) {
+		threadCount.set(count);
+	}
+
+	public Float getTime() {
+		return time.get();
+	}
+
+	public void setTime(Integer itime) {
+		time.set(itime);
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/ControlSet.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/ControlSet.java
new file mode 100644
index 0000000000000000000000000000000000000000..9c47d195b4d5dc791ce0b2df9dbe58258ccd6a2c
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/ControlSet.java
@@ -0,0 +1,81 @@
+package fi.utu.tech.ThreadRunner.dispatchers;
+
+/*
+ * Käyttöliittymästä saatavan kontrollitiedon mallintava luokka. Tämän luokan gettereitä käyttämällä tehtävässä saadaan 
+ * käyttöliittymässä asetetut arvot.
+ * 
+ * DO NOT EDIT
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class ControlSet {
+
+	private String taskType;
+	private String workerType;
+	private Integer maxtime;
+	private Integer threadCount;
+	private Integer amountTasks;
+
+	public ControlSet() {
+		this.taskType = "ConstantTask";
+		this.workerType = "ForWorker";
+		this.maxtime = Integer.valueOf(1);
+	}
+
+	public ControlSet(String type, String worker, Integer maxTime, Integer threadCount, Integer amountTasks) {
+		this.taskType = type;
+		this.workerType = worker;
+		this.maxtime = maxTime;
+		this.threadCount = threadCount;
+		this.amountTasks = amountTasks;
+
+	}
+
+	/**
+	 * Metodi, joka palauttaa valitun tehtävätyypin
+	 *
+	 * @return String task-luokan tyyppi
+	 **/
+	public String getTaskType() {
+		return this.taskType;
+	}
+
+	/**
+	 * Metodi, joka palauttaa valitun kuormatyypin
+	 *
+	 * @return String worker-luokan tyyppi
+	 **/
+	public String getWorkerType() {
+		return this.workerType;
+	}
+
+	/**
+	 * Metodi, joka palauttaa valitun kuoman
+	 *
+	 * @return Integer kuorman suuruus
+	 **/
+	public Integer getMaxTime() {
+		return this.maxtime;
+	}
+
+	/**
+	 * Metodi, joka palauttaa valitun säikeiden määrän
+	 *
+	 * @return Integer säikeiden määrä
+	 **/
+	public Integer getThreadCount() {
+		return this.threadCount;
+	}
+
+	/**
+	 * Metodi, joka palauttaa valitun tehtävien määrän
+	 *
+	 * @return Integer tehtävien määrä
+	 **/
+	public Integer getAmountTasks() {
+		return this.amountTasks;
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/Dispatcher.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/Dispatcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..fd61b53ddaff2c2e7f9856b734d45d5e131d8c75
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/Dispatcher.java
@@ -0,0 +1,17 @@
+package fi.utu.tech.ThreadRunner.dispatchers;
+
+/*
+ * Rajapintaluokka erityyppisten Dispatcher-luokkien käsittelyyn.
+ * 
+ * DO NOT EDIT
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public interface Dispatcher {
+
+	public void dispatch(ControlSet controlSet);
+
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/DynamicDispatcher.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/DynamicDispatcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..6b16e9d34327d34e7fe5a8b7b5d9c2bfc2c653c8
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/DynamicDispatcher.java
@@ -0,0 +1,87 @@
+package fi.utu.tech.ThreadRunner.dispatchers;
+
+import java.util.ArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import fi.utu.tech.ThreadRunner.tasks.Countable;
+import fi.utu.tech.ThreadRunner.tasks.TaskFactory;
+import fi.utu.tech.ThreadRunner.workers.Worker;
+import fi.utu.tech.ThreadRunner.workers.WorkerFactory;
+
+/*
+ * Luokka, jossa toteutetaan dynaaminen tehtävien jako ts. työn tehtävä 2
+ * 
+* @author      Eemeli Eronen ja Elias Ervelä
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class DynamicDispatcher implements Dispatcher{
+
+	/**
+	 * Metodi, jossa on toteutetaan staattisen tehtävän jaon toiminnallisuus.
+	 *
+	 *
+	 * @param ControlSet Käyttöliittymässä asetettu arvot välittyvät tässä oliossa
+	 * @return void
+	 * 
+	 */
+	public void dispatch(ControlSet controlSet) {
+		try {
+			Countable co = TaskFactory.createTask(controlSet.getTaskType());
+			ArrayList<Integer> ilist = co.generate(controlSet.getAmountTasks(), controlSet.getMaxTime()); 
+			//ilist sisältää tehtävät
+			int s = controlSet.getThreadCount().intValue();
+			
+			ExecutorService executor = Executors.newFixedThreadPool(s);
+			
+			for(int i = 0; i<ilist.size();i++) {
+				executor.execute(new Jarmo(ilist.get(i),controlSet.getWorkerType()));
+			}
+			executor.shutdown();
+			
+			try {
+			     // Wait a while for existing tasks to terminate
+			     if (!executor.awaitTermination(60, TimeUnit.SECONDS)) {
+			       executor.shutdownNow(); // Cancel currently executing tasks
+			       // Wait a while for tasks to respond to being cancelled
+			       if (!executor.awaitTermination(60, TimeUnit.SECONDS))
+			           System.err.println("Pool did not terminate");
+			     }
+			   } catch (InterruptedException ie) {
+			     // (Re-)Cancel if current thread also interrupted
+			     executor.shutdownNow();
+			     // Preserve interrupt status
+			     Thread.currentThread().interrupt();
+			   }
+			
+		}
+		catch(Exception ex) {
+			ex.printStackTrace();
+		}
+	}
+
+}
+
+class Jarmo implements Runnable{
+	Integer homma;
+	String tekijatyyppi;
+	
+	public Jarmo(Integer homma,String tekijatyyppi) {
+		this.homma = homma;
+		this.tekijatyyppi = tekijatyyppi;
+	}
+	
+	@Override 
+	public void run() {
+		try {
+			Worker worker = WorkerFactory.createWorker(tekijatyyppi);
+			worker.count(homma);
+			
+		}catch (InterruptedException e) {}
+		catch (Exception e) {}
+	}
+}
+
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/StaticDispatcher.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/StaticDispatcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..37683966ada89f1516f63b428eb833e0b479a2d8
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/StaticDispatcher.java
@@ -0,0 +1,78 @@
+package fi.utu.tech.ThreadRunner.dispatchers;
+import java.util.*;
+import fi.utu.tech.ThreadRunner.tasks.Countable;
+import fi.utu.tech.ThreadRunner.tasks.TaskFactory;
+import fi.utu.tech.ThreadRunner.workers.Worker;
+import fi.utu.tech.ThreadRunner.workers.WorkerFactory;
+/*
+ * Luokka, jossa toteutetaan staattinen tehtävien jako ts. työn tehtävä 1
+ * 
+* @author      Eemeli Eronen ja Elias Ervelä
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class StaticDispatcher implements Dispatcher {
+
+	/**
+	 * Metodi, jossa on toteutettu staattinen tehtäväjako toiminnallisuus.
+	 *
+	 *
+	 * @param ControlSet Käyttöliittymässä asetettu arvot välittyvät tässä oliossa
+	 * @return void
+	 * 
+	 */
+	public void dispatch(ControlSet controlSet) {
+		
+		int s = controlSet.getThreadCount().intValue();
+		
+		try {
+			Countable co = TaskFactory.createTask(controlSet.getTaskType());
+			ArrayList<Integer> ilist = co.generate(controlSet.getAmountTasks(), controlSet.getMaxTime()); 
+			//ilist sisältää tehtävät
+
+			
+					
+			Jorma[] armyOfJormas = new Jorma[s];   
+			for (int i=0; i<s;i++) {
+				
+				int alku = i*ilist.size()/s;
+				int loppu = (i+1)*ilist.size()/s;
+			
+				armyOfJormas[i] = new Jorma(ilist.subList(alku,loppu) , controlSet.getWorkerType());
+			}
+			for(Jorma j : armyOfJormas) {
+				j.start();
+			}
+			for (int i=0; i<s; i++) {
+				armyOfJormas[i].join(0);
+			}
+			
+		} catch (Exception ex) {
+			ex.printStackTrace();
+		}
+		
+		
+	}
+}
+
+class Jorma extends Thread{
+	List<Integer> hommia;
+	String tekijatyyppi;
+	
+	public Jorma(List<Integer> hommia,String tekijatyyppi) {
+		this.hommia = hommia;
+		this.tekijatyyppi = tekijatyyppi;
+	}
+	
+	@Override 
+	public void run() {
+		try {
+			Worker worker = WorkerFactory.createWorker(tekijatyyppi);
+			for(int i=0; i<hommia.size(); i++) {
+			worker.count(hommia.get(i));
+			}
+		}catch (InterruptedException e) {}
+		catch (Exception e) {}
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/WithOutThreadsDispatcher.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/WithOutThreadsDispatcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..0cc27b8cc907125cbed7f20279154b9992df68bc
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/dispatchers/WithOutThreadsDispatcher.java
@@ -0,0 +1,46 @@
+package fi.utu.tech.ThreadRunner.dispatchers;
+
+/*
+ * Ilman säikeiden luontia toteutettu esimerkki laskennasta. 
+ * 
+ * 
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+import java.util.ArrayList;
+import fi.utu.tech.ThreadRunner.tasks.Countable;
+import fi.utu.tech.ThreadRunner.tasks.TaskFactory;
+import fi.utu.tech.ThreadRunner.workers.Worker;
+import fi.utu.tech.ThreadRunner.workers.WorkerFactory;
+
+public class WithOutThreadsDispatcher implements Dispatcher {
+
+	/**
+	 * Metodi, jossa on toteutettu laskennan toiminnallisuus.
+	 *
+	 *
+	 * @param ControlSet Käyttöliittymässä asetettu arvot välittyvät tässä oliossa
+	 * @return void
+	 * 
+	 */
+	public void dispatch(ControlSet controlSet) {
+
+		try {
+			Countable co = TaskFactory.createTask(controlSet.getTaskType());
+			ArrayList<Integer> ilist = co.generate(controlSet.getAmountTasks(), controlSet.getMaxTime());
+
+			Worker worker = WorkerFactory.createWorker(controlSet.getWorkerType());
+
+			for (int time : ilist) {
+				worker.count(time);
+			}
+		} catch (Exception ex) {
+			ex.printStackTrace();
+		}
+
+	}
+
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/AbstractTask.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/AbstractTask.java
new file mode 100644
index 0000000000000000000000000000000000000000..8e8b72df46e75c1b2344fa6e59e8cfd9d30e1828
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/AbstractTask.java
@@ -0,0 +1,24 @@
+package fi.utu.tech.ThreadRunner.tasks;
+
+import java.util.ArrayList;
+
+/*
+ * Kaikille Task-luokille yhteinen abstraksi yläluokka. Luokkaan on kirjoitettuna ainoastaan oletustotetutus 
+ * generate-metodille, joka ylikirjoitetaan varsinaisissa Task-luokissa.
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public abstract class AbstractTask {
+
+	protected int multiplier = 100;
+
+	public ArrayList<Integer> generate(int size, int maxtime) {
+		ArrayList<Integer> list = new ArrayList<Integer>(size);
+		list.forEach(n -> list.add(n, Integer.valueOf(1)));
+		return list;
+	}
+
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/ConstantTask.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/ConstantTask.java
new file mode 100644
index 0000000000000000000000000000000000000000..22d7bd431ce228aee3d0c7f87be3a685e49c608d
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/ConstantTask.java
@@ -0,0 +1,32 @@
+package fi.utu.tech.ThreadRunner.tasks;
+
+import java.util.ArrayList;
+
+/*
+ * Luokka, joka generoi vakioaikaisen kuorman sisältävän työjonon. Tuloksena saatavan Arraylistin arvot kaikki samoja.
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class ConstantTask extends AbstractTask implements Countable {
+
+	/**
+	 * Metodi, joka generoi työjonon
+	 *
+	 *
+	 * @param size    tehtävien määrä
+	 * @param maxtime kuormaa kuvaava muuttuja
+	 * @return ArrayList<Integer> työjono
+	 * 
+	 */
+	public ArrayList<Integer> generate(int size, int maxtime) {
+		ArrayList<Integer> list = new ArrayList<Integer>(size);
+		for (int i = 1; i <= size; i++) {
+			list.add(Integer.valueOf(maxtime));
+		}
+		return list;
+	}
+
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/Countable.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/Countable.java
new file mode 100644
index 0000000000000000000000000000000000000000..b9c1d53de6855e9024a966902d5217f361d22b02
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/Countable.java
@@ -0,0 +1,17 @@
+package fi.utu.tech.ThreadRunner.tasks;
+
+/*
+ * Rajapintaluokka erityyppisten Task-luokkien käsittelyyn.
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+import java.util.ArrayList;
+
+public interface Countable {
+
+	public ArrayList<Integer> generate(int size, int maxtime);
+
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/DO_NOT_EDIT_FILES_IN_THIS_FOLDER b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/DO_NOT_EDIT_FILES_IN_THIS_FOLDER
new file mode 100644
index 0000000000000000000000000000000000000000..6d21862260e3e789aa19d95c57a7b1033c1d237e
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/DO_NOT_EDIT_FILES_IN_THIS_FOLDER
@@ -0,0 +1 @@
+Editing of files in this folder is not needed.
\ No newline at end of file
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/HalfAndHalf.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/HalfAndHalf.java
new file mode 100644
index 0000000000000000000000000000000000000000..ac09e5fe1ce0904f9045bf696e33e0aa3bf3f1e0
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/HalfAndHalf.java
@@ -0,0 +1,36 @@
+package fi.utu.tech.ThreadRunner.tasks;
+
+import java.util.ArrayList;
+
+/*
+ * Luokka, joka generoi kaksijakoisen kuorman sisältävän työjonon. Tuloksena saatavan Arraylistin arvoista 
+ * puolet ovat kuormaa kuvaavan muuttujan kokoisia ja puolet sen monikertoja
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class HalfAndHalf extends AbstractTask implements Countable {
+
+	/**
+	 * Metodi, joka generoi työjonon
+	 *
+	 *
+	 * @param size    tehtävien määrä
+	 * @param maxtime kuormaa kuvaava muuttuja
+	 * @return ArrayList<Integer> työjono
+	 * 
+	 */
+	public ArrayList<Integer> generate(int size, int maxtime) {
+		ArrayList<Integer> list = new ArrayList<Integer>(size);
+		int half = size / 2;
+		for (int i = 1; i < half; i++) {
+			list.add(Integer.valueOf(maxtime));
+		}
+		for (int i = half; i <= size; i++) {
+			list.add(Integer.valueOf(maxtime * multiplier));
+		}
+		return list;
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/LinearTask.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/LinearTask.java
new file mode 100644
index 0000000000000000000000000000000000000000..d8ee2c1ae0cb44814be1b932ec1b2ab07ffe79ea
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/LinearTask.java
@@ -0,0 +1,34 @@
+package fi.utu.tech.ThreadRunner.tasks;
+
+import java.util.ArrayList;
+
+/*
+ * Luokka, joka generoi lineaarisesti kasvavan kuorman sisältävän työjonon. 
+ * Tuloksena saatavan Arraylistin arvot kasvavat maxtime muuttujan verran siirryttäessä seuraavaan tehtävään jonossa.
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class LinearTask extends AbstractTask implements Countable {
+
+	/**
+	 * Metodi, joka generoi työjonon
+	 *
+	 *
+	 * @param size    tehtävien määrä
+	 * @param maxtime kuormaa kuvaava muuttuja
+	 * @return ArrayList<Integer> työjono
+	 * 
+	 */
+	public ArrayList<Integer> generate(int size, int maxtime) {
+		ArrayList<Integer> list = new ArrayList<Integer>(size);
+		for (int i = 1; i <= size; i++) {
+			list.add(i * maxtime);
+			System.out.println(i * maxtime);
+		}
+		return list;
+	}
+
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/OneEigth.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/OneEigth.java
new file mode 100644
index 0000000000000000000000000000000000000000..f0b870f457f238db703b8affee61fe7fd291d50f
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/OneEigth.java
@@ -0,0 +1,36 @@
+package fi.utu.tech.ThreadRunner.tasks;
+
+import java.util.ArrayList;
+
+/*
+ * Luokka, joka generoi kahdeksanjakoisen kuorman sisältävän työjonon. Tuloksena saatavan Arraylistin arvoista 
+ * 7/8 on kuormaa kuvaavan muuttujan kokoisia ja 1/8 sen monikertoja
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class OneEigth extends AbstractTask implements Countable {
+
+	/**
+	 * Metodi, joka generoi työjonon
+	 *
+	 *
+	 * @param size    tehtävien määrä
+	 * @param maxtime kuormaa kuvaava muuttuja
+	 * @return ArrayList<Integer> työjono
+	 * 
+	 */
+	public ArrayList<Integer> generate(int size, int maxtime) {
+		ArrayList<Integer> list = new ArrayList<Integer>(size);
+		int part = size / 8;
+		for (int i = 1; i < part * 7; i++) {
+			list.add(Integer.valueOf(maxtime));
+		}
+		for (int i = part * 7; i <= size; i++) {
+			list.add(Integer.valueOf(maxtime * multiplier));
+		}
+		return list;
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/OneFourth.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/OneFourth.java
new file mode 100644
index 0000000000000000000000000000000000000000..7196414e16c21b389b4ff4a2eaaa796cb8619dfd
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/OneFourth.java
@@ -0,0 +1,36 @@
+package fi.utu.tech.ThreadRunner.tasks;
+
+import java.util.ArrayList;
+
+/*
+ * Luokka, joka generoi nelijakoisen kuorman sisältävän työjonon. Tuloksena saatavan Arraylistin arvoista 
+ * kolme neljäsosaa on kuormaa kuvaavan muuttujan kokoisia ja yksi neljäsosa sen monikertoja
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class OneFourth extends AbstractTask implements Countable {
+
+	/**
+	 * Metodi, joka generoi työjonon
+	 *
+	 *
+	 * @param size    tehtävien määrä
+	 * @param maxtime kuormaa kuvaava muuttuja
+	 * @return ArrayList<Integer> työjono
+	 * 
+	 */
+	public ArrayList<Integer> generate(int size, int maxtime) {
+		ArrayList<Integer> list = new ArrayList<Integer>(size);
+		int part = size / 4;
+		for (int i = 1; i < part * 3; i++) {
+			list.add(Integer.valueOf(maxtime));
+		}
+		for (int i = part * 3; i <= size; i++) {
+			list.add(Integer.valueOf(maxtime * multiplier));
+		}
+		return list;
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/README.md b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..107547d449ceb7c9eb004db57e39fa1fe03d0b16
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/README.md
@@ -0,0 +1,17 @@
+## Package fi.utu.tech.Threadrunner.tasks
+
+Tämän pakkauksen luokat edustavat työssä käytettäviä työjonoja ts. tehtäviä, joita annetaan worker-olioiden suoritettavaksi.
+ 
+
+Countable.java on rajapinta, jonka kaikki task-luokat toteuttavat. WorkerFactory on factory-luokka, 
+jonka createTask(Integer amount, Integer time)-luokkaa kutsumalla luodaan uuden task-oliot.
+
+## Käyttö
+
+### Halutun Task-olion luonti
+
+Countable w = TaskFactory.createTask(name of task as a string);
+
+### Työjonon generointi
+
+ArrayList<Integer> list = co.generate(controlSet.getAmountTasks() , controlSet.getMaxTime());
\ No newline at end of file
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/TaskFactory.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/TaskFactory.java
new file mode 100644
index 0000000000000000000000000000000000000000..a10377a53eea1e70b05372696d758d9b13f6a1ab
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/tasks/TaskFactory.java
@@ -0,0 +1,45 @@
+package fi.utu.tech.ThreadRunner.tasks;
+
+/*
+ * Factory-luokka, jota käyttämällä luodaan task-oliot
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class TaskFactory {
+
+	/**
+	 * Metodi, joka generoi työjonon
+	 *
+	 *
+	 * @param String halutun task-olion tyyppi
+	 * @return Countable palautuva task-olio
+	 * 
+	 */
+	public static Countable createTask(String type) throws Exception {
+		switch (type) {
+		case "ConstantTask":
+			return new ConstantTask();
+		case "LinearTask":
+			return new LinearTask();
+		case "HalfAndHalf":
+			return new HalfAndHalf();
+		case "OneFourth":
+			return new OneFourth();
+		case "OneEigth":
+			return new OneEigth();
+		default:
+			throw new Exception("Unknown task type " + type);
+		}
+	}
+
+	/**
+	 * Käyttöliittymään liittyvä metodi. Ei tarvita työn toteutuksessa.
+	 *
+	 */
+	public static String[] getTaskTypes() {
+		return new String[] { "ConstantTask", "LinearTask", "HalfAndHalf", "OneFourth", "OneEigth" };
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/DO_NOT_EDIT_FILES_IN_THIS_FOLDER b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/DO_NOT_EDIT_FILES_IN_THIS_FOLDER
new file mode 100644
index 0000000000000000000000000000000000000000..6d21862260e3e789aa19d95c57a7b1033c1d237e
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/DO_NOT_EDIT_FILES_IN_THIS_FOLDER
@@ -0,0 +1 @@
+Editing of files in this folder is not needed.
\ No newline at end of file
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/ForWorker.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/ForWorker.java
new file mode 100644
index 0000000000000000000000000000000000000000..11ed2441b2fa3a2a56a5ed6a317f31fa44bb5580
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/ForWorker.java
@@ -0,0 +1,36 @@
+package fi.utu.tech.ThreadRunner.workers;
+
+import java.util.concurrent.TimeUnit;
+
+/*
+ * Keinotekoinen kuorma, jolla tuotetaan määränajan kestävä työtehtävä säikeelle.
+ * 
+ * Tämä tehtävä toissijaisesti käytettävä kuorma.
+ * 
+ * Tämän kuorman ideana on demontroida sisäkkäisten silmukoiden kuormittavuutta. Sisin silmukka odottaa vain yhden
+ * nanosekunnin, mutta kaksi sisäkkäistä silmukkaa helposti moninkertaistavat viiveen. Huom. iso-Ordo n^2
+ * 
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class ForWorker implements Worker {
+
+	/**
+	 * Metodi, jota kutsutaan säikeessä.
+	 *
+	 *
+	 * @param data Käytetään kasvattamaan viivettä.
+	 * @return void
+	 * 
+	 */
+	public void count(Integer data) throws Exception {
+		for (int i = 0; i < data.intValue(); i++) {
+			for (int j = 0; j < data.intValue(); j++) {
+				TimeUnit.NANOSECONDS.sleep(1);
+			}
+		}
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/README.md b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..928a98ff5b27420359ec099f638dfe16fd7c5d2c
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/README.md
@@ -0,0 +1,17 @@
+## Package fi.utu.tech.Threadrunner.workers
+
+Tämän pakkauksen luokat edustavat työssä käytettäviä kuormia ts. töitä, joita säikeet suorittavat. 
+
+Worker.java on rajapinta, jonka kaikki worker-luokat toteuttavat. WorkerFactory on factory-luokka, 
+jonka createWorker(String type)-luokkaa kutsumalla luodaan uuden worker-oliot.
+
+## Käyttö
+
+
+#### Uuden worker-olion luonti
+
+Worker w = WorkerFactory.createWorker(workerType as a string);
+
+#### Laskennan suoritus
+
+w.count(data as Integer);
\ No newline at end of file
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/SleepWorker.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/SleepWorker.java
new file mode 100644
index 0000000000000000000000000000000000000000..e89b14ca5316c09182ef8bfcf77c760ddd8d614d
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/SleepWorker.java
@@ -0,0 +1,29 @@
+package fi.utu.tech.ThreadRunner.workers;
+
+import java.util.concurrent.TimeUnit;
+
+/*
+ * Keinotekoinen kuorma, jolla tuotetaan määränajan kestävä työtehtävä säikeelle.
+ * 
+ * Tämä tehtävä ensisijaisesti käytettävä kuorma.
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class SleepWorker implements Worker {
+
+	/**
+	 * Metodi, jota kutsutaan säikeessä.
+	 *
+	 *
+	 * @param data Viive, jonka yksittäinen tehtävä odottaa.
+	 * @return void
+	 * 
+	 */
+	public void count(Integer data) throws Exception {
+		TimeUnit.MILLISECONDS.sleep(data.intValue());
+	}
+
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/Worker.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/Worker.java
new file mode 100644
index 0000000000000000000000000000000000000000..ed0a81afe50d8995655b51b37d16a760128959a3
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/Worker.java
@@ -0,0 +1,14 @@
+package fi.utu.tech.ThreadRunner.workers;
+
+/*
+ * Rajapintaluokka erityyppisten Worker-luokkien käsittelyyn.
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public interface Worker {
+
+	public void count(Integer data) throws Exception;
+}
diff --git a/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/WorkerFactory.java b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/WorkerFactory.java
new file mode 100644
index 0000000000000000000000000000000000000000..97f4813c8c064ae0252f07c4cbca66283bfc375c
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/fi/utu/tech/ThreadRunner/workers/WorkerFactory.java
@@ -0,0 +1,39 @@
+package fi.utu.tech.ThreadRunner.workers;
+
+/*
+ * Factory-luokka, jota käyttämällä luodaan worker-oliot
+ * 
+* @author      Jari Lehto <jaanle@utu.fi>
+* @version     1.0                 
+* @since       1.0          
+*/
+
+public class WorkerFactory {
+
+	/**
+	 * Metodi, joka generoi työjonon
+	 *
+	 *
+	 * @param String halutun worker-olion tyyppi
+	 * @return Countable palautuva worker-olio
+	 * 
+	 */
+	public static Worker createWorker(String type) throws Exception {
+		switch (type) {
+		case "ForWorker":
+			return new ForWorker();
+		case "SleepWorker":
+			return new SleepWorker();
+		default:
+			throw new Exception("Unknown worker type " + type);
+		}
+	}
+
+	/**
+	 * Käyttöliittymään liittyvä metodi. Ei tarvita työn toteutuksessa.
+	 *
+	 */
+	public static String[] getWorkerTypes() {
+		return new String[] { "ForWorker", "SleepWorker" };
+	}
+}
diff --git a/threadrunner-assignment-master/src/main/java/module-info.java b/threadrunner-assignment-master/src/main/java/module-info.java
new file mode 100644
index 0000000000000000000000000000000000000000..34fc3d7cfc3a887c4f97ab730897d2927d39e69a
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/java/module-info.java
@@ -0,0 +1,12 @@
+module fi.utu.tech.ThreadRunner {
+    requires javafx.controls;
+    requires javafx.fxml;
+    requires transitive javafx.graphics;
+	requires javafx.base;
+
+    opens fi.utu.tech.ThreadRunner to javafx.fxml;
+    opens fi.utu.tech.ThreadRunner.UI to javafx.fxml;
+    exports fi.utu.tech.ThreadRunner;
+    exports fi.utu.tech.ThreadRunner.UI;
+    exports fi.utu.tech.ThreadRunner.dispatchers;
+}
\ No newline at end of file
diff --git a/threadrunner-assignment-master/src/main/resources/fi/utu/tech/ThreadRunner/mainWindow.fxml b/threadrunner-assignment-master/src/main/resources/fi/utu/tech/ThreadRunner/mainWindow.fxml
new file mode 100644
index 0000000000000000000000000000000000000000..fc82ecdfc9b3802a1682c8c5456a229b71c45a74
--- /dev/null
+++ b/threadrunner-assignment-master/src/main/resources/fi/utu/tech/ThreadRunner/mainWindow.fxml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.control.ComboBox?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.Spinner?>
+<?import javafx.scene.control.SplitPane?>
+<?import javafx.scene.control.Tab?>
+<?import javafx.scene.control.TabPane?>
+<?import javafx.scene.control.TableColumn?>
+<?import javafx.scene.control.TableView?>
+<?import javafx.scene.image.ImageView?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.VBox?>
+<?import javafx.scene.text.Font?>
+
+<SplitPane dividerPositions="0.7" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fi.utu.tech.ThreadRunner.UI.MainWindowController">
+   <items>
+      <SplitPane dividerPositions="0.9" orientation="VERTICAL">
+        <items>
+          <AnchorPane>
+               <children>
+                  <VBox layoutX="228.0" layoutY="141.0" />
+                  <Label layoutX="14.0" layoutY="25.0" text="ThreadRunner">
+                     <font>
+                        <Font name="Calibri" size="27.0" />
+                     </font>
+                  </Label>
+                  <TabPane layoutX="14.0" layoutY="79.0" tabClosingPolicy="UNAVAILABLE">
+                    <tabs>
+                        <Tab text="Without threads">
+                          <content>
+                            <AnchorPane minHeight="0.0" minWidth="0.0">
+                                 <children>
+                                    <TableView fx:id="wotTable">
+                                      <columns>
+                                        <TableColumn fx:id="wotTaskTypeColumn" maxWidth="80.0" minWidth="80.0" resizable="false" text="Tasktype" />
+                                        <TableColumn fx:id="wotWorkerTypeColumn" maxWidth="80.0" minWidth="80.0" resizable="false" text="Workertype" />
+                                          <TableColumn fx:id="wotAmountTaskColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" resizable="false" text="Amount of tasks" />
+                                          <TableColumn fx:id="wotThreadCountColumn" maxWidth="60.0" minWidth="60.0" prefWidth="60.0" resizable="false" text="Threads" />
+                                          <TableColumn fx:id="wotMaxTimeColumn" maxWidth="70.0" minWidth="70.0" prefWidth="70.0" resizable="false" text="Max load" />
+                                          <TableColumn fx:id="wotTimeTypeColumn" maxWidth="200.0" minWidth="90.0" prefWidth="90.0" text="Time" />
+                                      </columns>
+                                    </TableView>
+                                 </children>
+                              </AnchorPane>
+                          </content>
+                        </Tab>
+                      <Tab text="Static runs">
+                        <content>
+                          <AnchorPane>
+                                 <children>
+                                    <TableView fx:id="staticTable">
+                                      <columns>
+                                        <TableColumn fx:id="staticTaskTypeColumn" maxWidth="80.0" minWidth="80.0" resizable="false" text="Tasktype" />
+                                        <TableColumn fx:id="staticWorkerTypeColumn" maxWidth="80.0" minWidth="80.0" resizable="false" text="Workertype" />
+                                          <TableColumn fx:id="staticAmountTaskColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" resizable="false" text="Amount of tasks" />
+                                          <TableColumn fx:id="staticThreadCountColumn" maxWidth="60.0" minWidth="60.0" prefWidth="60.0" resizable="false" text="Threads" />
+                                          <TableColumn fx:id="staticMaxTimeColumn" maxWidth="70.0" minWidth="70.0" prefWidth="70.0" resizable="false" text="Max load" />
+                                          <TableColumn fx:id="staticTimeTypeColumn" maxWidth="200.0" minWidth="90.0" prefWidth="90.0" text="Time" />
+                                      </columns>
+                                    </TableView>
+                                 </children>
+                              </AnchorPane>
+                        </content>
+                      </Tab>
+                      <Tab text="Dynamic runs">
+                        <content>
+                          <AnchorPane minHeight="0.0" minWidth="0.0">
+                                 <children>
+                                    <TableView fx:id="dynamicTable">
+                                      <columns>
+                                        <TableColumn fx:id="dynamicTaskTypeColumn" maxWidth="80.0" minWidth="80.0" resizable="false" text="Tasktype" />
+                                        <TableColumn fx:id="dynamicWorkerTypeColumn" maxWidth="80.0" minWidth="80.0" resizable="false" text="Workertype" />
+                                          <TableColumn fx:id="dynamicAmountTaskColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" resizable="false" text="Amount of tasks" />
+                                          <TableColumn fx:id="dynamicThreadCountColumn" maxWidth="60.0" minWidth="60.0" prefWidth="60.0" resizable="false" text="Threads" />
+                                          <TableColumn fx:id="dynamicMaxTimeColumn" maxWidth="70.0" minWidth="70.0" prefWidth="70.0" resizable="false" text="Max load" />
+                                          <TableColumn fx:id="dynamicTimeTypeColumn" maxWidth="200.0" minWidth="90.0" prefWidth="90.0" text="Time" />
+                                      </columns>
+                                    </TableView>
+                                 </children>
+                              </AnchorPane>
+                        </content>
+                      </Tab>
+                    </tabs>
+                  </TabPane>
+               </children>
+            </AnchorPane>
+          <AnchorPane maxHeight="-Infinity" minHeight="-Infinity" minWidth="500.0" prefHeight="50.0" SplitPane.resizableWithParent="false">
+               <children>
+                  <Button layoutX="237.0" layoutY="13.0" onAction="#runStatic" text="Run static" />
+                  <Button layoutX="371.0" layoutY="12.0" mnemonicParsing="false" onAction="#runDynamic" text="Run dynamic" />
+                  <Button layoutX="47.0" layoutY="13.0" mnemonicParsing="false" onAction="#runWot" text="Run without threads" />
+               </children>
+            </AnchorPane>
+        </items>
+      </SplitPane>
+      <AnchorPane maxWidth="-Infinity" minWidth="-Infinity" prefWidth="250.0" SplitPane.resizableWithParent="false">
+         <children>
+            <VBox layoutX="68.0" layoutY="178.0" maxWidth="-Infinity" />
+            <Spinner fx:id="maxTimeSpinner" editable="true" layoutX="44.0" layoutY="384.0" />
+            <ImageView fx:id="taskImage" fitHeight="150.0" fitWidth="200.0" layoutX="18.0" layoutY="14.0" pickOnBounds="true" preserveRatio="true" />
+            <ComboBox fx:id="taskTypeComboBox" layoutX="45.0" layoutY="194.0" prefWidth="150.0" />
+            <ComboBox fx:id="workerTypeComboBox" layoutX="45.0" layoutY="250.0" prefWidth="150.0" />
+            <Label layoutX="45.0" layoutY="178.0" text="Select task type:" />
+            <Label layoutX="45.0" layoutY="233.0" text="Select worker type:" />
+            <Label layoutX="44.0" layoutY="367.0" text="Set load:" />
+            <Spinner fx:id="threadCountSpinner" editable="true" layoutX="43.0" layoutY="444.0" />
+            <Label layoutX="43.0" layoutY="427.0" text="Set threadcount" />
+            <Spinner fx:id="amountTasksSpinner" editable="true" layoutX="43.0" layoutY="334.0" />
+            <Label layoutX="45.0" layoutY="317.0" text="Amount of tasks" />
+         </children>
+      </AnchorPane>
+   </items>
+</SplitPane>